Class FlinkPublishApiImpl
- All Implemented Interfaces:
FlinkPublishApi
-
Constructor Summary
ConstructorsConstructorDescriptionFlinkPublishApiImpl(Settings settings, scala.Function0<PublishApi> toCreatePublishApi, DataClientFlinkContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelBatch(BatchToken token) Cancels a batch operation.voidcompleteBatch(BatchToken token) Finalizes the batch and waits until the metadata has been processed.deleteFeatures(String layer, List<String> ids) Deletes specified features from Interactive Map layer.deleteIndex(String layer, String queryString) Deletes the partitions from index layer that match the provided query written in the RSQL query language.Get latest version available for the given catalog which can be used inFlinkPublishApi.startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).patchFeature(String layer, Feature feature, String featureId) Patch specified feature in Interactive Map layer.patchFeatureJson(String layer, String feature, String featureId) Patch specified feature in Interactive Map layer.postFeatureCollection(String layer, FeatureCollection featureCollection, Optional<InteractiveMapOptions.IfExistType> ifExist, Optional<InteractiveMapOptions.IfNotExistType> ifNotExist, Boolean transactional) Uploads specified FeatureCollection to Interactive Map layer.postFeatureCollectionJson(String layer, String featureCollection, Optional<InteractiveMapOptions.IfExistType> ifExist, Optional<InteractiveMapOptions.IfNotExistType> ifNotExist, Boolean transactional) Uploads specified FeatureCollection to Interactive Map layer.postFeatureModifications(String layer, FeatureModificationList featureModificationList, Boolean transactional) Uploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.postFeatureModificationsJson(String layer, String featureModificationList, Boolean transactional) Uploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.voidpublishBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies, Iterator<CommitPartition> partitions) Performs new batch publication to a catalog.voidpublishIndex(String layer, Iterator<CommitPartition> partitions) Performs indexing of the specified partitions in Index layer.voidpublishToBatch(BatchToken token, Iterator<CommitPartition> partitions) Upload partitions for given commit token.putFeature(String layer, Feature feature, String featureId) Uploads specified feature to Interactive Map layer.putFeatureCollection(String layer, FeatureCollection featureCollection) Uploads specified FeatureCollection to Interactive Map layer.putFeatureCollectionJson(String layer, String featureCollection) Uploads specified FeatureCollection to Interactive Map layer.putFeatureJson(String layer, String feature, String featureId) Uploads specified feature to Interactive Map layer.startBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies) Starts a new batch for a catalog with layers explicitly named.voidupdateIndex(String layer, Iterator<CommitPartition> additions, Iterator<CommitPartition> removals) Updates an index layer by adding theadditionspartitions and removingremovalspartitions.
-
Constructor Details
-
FlinkPublishApiImpl
public FlinkPublishApiImpl(Settings settings, scala.Function0<PublishApi> toCreatePublishApi, DataClientFlinkContext context)
-
-
Method Details
-
cancelBatch
Description copied from interface:FlinkPublishApiCancels a batch operation.Cancels an active batch and signals that submitted batch publications can be discarded. The token will no longer be valid after cancel batch operation.
- Specified by:
cancelBatchin interfaceFlinkPublishApi- Parameters:
token- Token retrieved from a functionFlinkPublishApi.startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).
-
completeBatch
Description copied from interface:FlinkPublishApiFinalizes the batch and waits until the metadata has been processed.- Specified by:
completeBatchin interfaceFlinkPublishApi- Parameters:
token- Token retrieved from a functionFlinkPublishApi.startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).
-
deleteFeatures
Description copied from interface:FlinkPublishApiDeletes specified features from Interactive Map layer.- Specified by:
deleteFeaturesin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.ids- List of feature IDs to be deleted- Returns:
- Future which completes when specified featureCollection is uploaded.
-
deleteIndex
Description copied from interface:FlinkPublishApiDeletes the partitions from index layer that match the provided query written in the RSQL query language.- Specified by:
deleteIndexin interfaceFlinkPublishApi- Parameters:
layer- Name of the index layer. If the layer specified in request does not exist, an error is returned.queryString- String written in the RSQL query language to query the index layer- Returns:
- Delete request id which can be used to query the delete status.
-
getBaseVersion
Description copied from interface:FlinkPublishApiGet latest version available for the given catalog which can be used inFlinkPublishApi.startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).- Specified by:
getBaseVersionin interfaceFlinkPublishApi- Returns:
- Returns Some(version) - latest version for the given catalog. If the catalog doesn't contain any versions None will be returned.
-
patchFeature
Description copied from interface:FlinkPublishApiPatch specified feature in Interactive Map layer.- Specified by:
patchFeaturein interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.feature- The feature to put in Interactive Map layer.featureId- The feature ID of the feature.- Returns:
- Future which completes when specified feature is patched.
-
patchFeatureJson
Description copied from interface:FlinkPublishApiPatch specified feature in Interactive Map layer.- Specified by:
patchFeatureJsonin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.feature- The feature to put in Interactive Map layer.featureId- The feature ID of the feature.- Returns:
- Future which completes when specified feature is patched.
-
postFeatureCollection
public FeatureCollection postFeatureCollection(String layer, FeatureCollection featureCollection, Optional<InteractiveMapOptions.IfExistType> ifExist, Optional<InteractiveMapOptions.IfNotExistType> ifNotExist, Boolean transactional) Description copied from interface:FlinkPublishApiUploads specified FeatureCollection to Interactive Map layer.- Specified by:
postFeatureCollectionin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureCollection- The FeatureCollection to put in Interactive Map layer.ifExist- The action to execute, when a feature with the provided ID exists. Default is PATCH.ifNotExist- The action to execute, when a feature with the provided ID does not exist or the feature contains no ID. Default is CREATE.transactional- Defines, if this is a transactional operation. Default is true.- Returns:
- Future which completes when specified featureCollection is uploaded.
-
postFeatureCollectionJson
public String postFeatureCollectionJson(String layer, String featureCollection, Optional<InteractiveMapOptions.IfExistType> ifExist, Optional<InteractiveMapOptions.IfNotExistType> ifNotExist, Boolean transactional) Description copied from interface:FlinkPublishApiUploads specified FeatureCollection to Interactive Map layer.- Specified by:
postFeatureCollectionJsonin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureCollection- The FeatureCollection to put in Interactive Map layer.ifExist- The action to execute, when a feature with the provided ID exists. Default is PATCH.ifNotExist- The action to execute, when a feature with the provided ID does not exist or the feature contains no ID. Default is CREATE.transactional- Defines, if this is a transactional operation. Default is true.- Returns:
- Future which completes when specified featureCollection is uploaded.
-
postFeatureModifications
public FeatureCollection postFeatureModifications(String layer, FeatureModificationList featureModificationList, Boolean transactional) Description copied from interface:FlinkPublishApiUploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.- Specified by:
postFeatureModificationsin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureModificationList- The FeatureModificationList which contains list of features that need to get created/updated/deleted in Interactive Map layer.transactional- Defines, if this is a transactional operation. Default is true.- Returns:
- Future which completes when specified FeatureCollection(s) are uploaded.
-
postFeatureModificationsJson
public String postFeatureModificationsJson(String layer, String featureModificationList, Boolean transactional) Description copied from interface:FlinkPublishApiUploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.- Specified by:
postFeatureModificationsJsonin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureModificationList- The FeatureModificationList which contains list of features that need to get created/updated/deleted in Interactive Map layer.transactional- Defines, if this is a transactional operation. Default is true.- Returns:
- Future which completes when specified FeatureCollection(s) are uploaded.
-
publishBatch2
public void publishBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies, Iterator<CommitPartition> partitions) Description copied from interface:FlinkPublishApiPerforms new batch publication to a catalog.Data for
CommitPartitionmust be already uploaded beforehandThis call is identical to
FlinkPublishApi.startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>)+ {@link publishToBatch(token:com\.here\.platform\.data\.client\.model\.BatchToken,partitions:java\.util\.Iterator*} +FlinkPublishApi.completeBatch(com.here.platform.data.client.model.BatchToken).
Please note that there can only be one active publication at a time per versioned layer.- Specified by:
publishBatch2in interfaceFlinkPublishApi- Parameters:
baseVersion- This parameter is deprecated and not used anymore.layerIds- List of layer ids which should be updated. Note: Publishing versioned and volatile layer partitions in the same publication is not advisable as in this case it increases version number even for volatile layers.dependencies- List of the dependencies for this publication. This is only relevant for publishing to versioned layer.partitions- partitions to publish.
-
publishIndex
Description copied from interface:FlinkPublishApiPerforms indexing of the specified partitions in Index layer.The partitions are indexed using the specified index keys defined in each indexing partition. After indexing the partitions can be searched by keys using query method from Query API.
- Specified by:
publishIndexin interfaceFlinkPublishApi- Parameters:
layer- Name of index layer. If the layer specified in request does not exist, an error is returned.partitions- The partitions to index.
-
publishToBatch
Description copied from interface:FlinkPublishApiUpload partitions for given commit token.- Specified by:
publishToBatchin interfaceFlinkPublishApi- Parameters:
token- Token retrieved from a functionFlinkPublishApi.startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).partitions- partitions to upload.
-
putFeature
Description copied from interface:FlinkPublishApiUploads specified feature to Interactive Map layer.- Specified by:
putFeaturein interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.feature- The feature to put in Interactive Map layer.featureId- The feature ID of the feature.- Returns:
- Future which completes when specified feature is uploaded.
-
putFeatureCollection
Description copied from interface:FlinkPublishApiUploads specified FeatureCollection to Interactive Map layer.- Specified by:
putFeatureCollectionin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureCollection- The FeatureCollection to put in Interactive Map layer.- Returns:
- Future which completes when specified featureCollection is uploaded.
-
putFeatureCollectionJson
Description copied from interface:FlinkPublishApiUploads specified FeatureCollection to Interactive Map layer.- Specified by:
putFeatureCollectionJsonin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureCollection- The FeatureCollection to put in Interactive Map layer.- Returns:
- Future which completes when specified featureCollection is uploaded.
-
putFeatureJson
Description copied from interface:FlinkPublishApiUploads specified feature to Interactive Map layer.- Specified by:
putFeatureJsonin interfaceFlinkPublishApi- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.feature- The feature to put in Interactive Map layer.featureId- The feature ID of the feature.- Returns:
- Future which completes when specified feature is uploaded.
-
startBatch2
public BatchToken startBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies) Description copied from interface:FlinkPublishApiStarts a new batch for a catalog with layers explicitly named.This call is used to start a new publishing to a catalog. The layers must be named explicitly. The returned token is valid for 24 hours.
Please note that there can only be one active publication at a time per versioned layer.- Specified by:
startBatch2in interfaceFlinkPublishApi- Parameters:
baseVersion- This parameter is deprecated and not used anymore.layerIds- List of layer ids which should be updated. Note: Publishing versioned and volatile layer partitions in the same publication is not advisable as in this case it increases version number even for volatile layers.dependencies- List of the dependencies for this publication. This is only relevant for publishing to versioned layer.- Returns:
- The token to use in subsequent calls that are part of the same publication (e.g.{@link publishToBatch(token:com\.here\.platform\.data\.client\.model\.BatchToken,partitions:java\.util\.Iterator*}).
-
updateIndex
public void updateIndex(String layer, Iterator<CommitPartition> additions, Iterator<CommitPartition> removals) Description copied from interface:FlinkPublishApiUpdates an index layer by adding theadditionspartitions and removingremovalspartitions.- Specified by:
updateIndexin interfaceFlinkPublishApi- Parameters:
layer- Name of the index layer. If the layer specified in request does not exist, an error is returned.additions- The partitions to add to the index.removals- The partitions to remove from the index.
-