Class FlinkPublishApiImpl

java.lang.Object
com.here.platform.data.client.flink.javadsl.FlinkPublishApiImpl
All Implemented Interfaces:
FlinkPublishApi

public class FlinkPublishApiImpl extends Object implements FlinkPublishApi
  • Constructor Details

  • Method Details

    • cancelBatch

      public void cancelBatch(BatchToken token)
      Description copied from interface: FlinkPublishApi
      Cancels 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:
      cancelBatch in interface FlinkPublishApi
      Parameters:
      token - Token retrieved from a function FlinkPublishApi.startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).
    • completeBatch

      public void completeBatch(BatchToken token)
      Description copied from interface: FlinkPublishApi
      Finalizes the batch and waits until the metadata has been processed.

      Specified by:
      completeBatch in interface FlinkPublishApi
      Parameters:
      token - Token retrieved from a function FlinkPublishApi.startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).
    • deleteFeatures

      public FeatureCollection deleteFeatures(String layer, List<String> ids)
      Description copied from interface: FlinkPublishApi
      Deletes specified features from Interactive Map layer.

      Specified by:
      deleteFeatures in interface FlinkPublishApi
      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

      public String deleteIndex(String layer, String queryString)
      Description copied from interface: FlinkPublishApi
      Deletes the partitions from index layer that match the provided query written in the RSQL query language.

      Specified by:
      deleteIndex in interface FlinkPublishApi
      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

      public OptionalLong getBaseVersion()
      Description copied from interface: FlinkPublishApi
      Specified by:
      getBaseVersion in interface FlinkPublishApi
      Returns:
      Returns Some(version) - latest version for the given catalog. If the catalog doesn't contain any versions None will be returned.
    • patchFeature

      public Feature patchFeature(String layer, Feature feature, String featureId)
      Description copied from interface: FlinkPublishApi
      Patch specified feature in Interactive Map layer.

      Specified by:
      patchFeature in interface FlinkPublishApi
      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

      public String patchFeatureJson(String layer, String feature, String featureId)
      Description copied from interface: FlinkPublishApi
      Patch specified feature in Interactive Map layer.

      Specified by:
      patchFeatureJson in interface FlinkPublishApi
      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: FlinkPublishApi
      Uploads specified FeatureCollection to Interactive Map layer.

      Specified by:
      postFeatureCollection in interface FlinkPublishApi
      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: FlinkPublishApi
      Uploads specified FeatureCollection to Interactive Map layer.

      Specified by:
      postFeatureCollectionJson in interface FlinkPublishApi
      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: FlinkPublishApi
      Uploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.

      Specified by:
      postFeatureModifications in interface FlinkPublishApi
      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: FlinkPublishApi
      Uploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.

      Specified by:
      postFeatureModificationsJson in interface FlinkPublishApi
      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: FlinkPublishApi
      Performs new batch publication to a catalog.

      Data for CommitPartition must be already uploaded beforehand

      This 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:
      publishBatch2 in interface FlinkPublishApi
      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

      public void publishIndex(String layer, Iterator<CommitPartition> partitions)
      Description copied from interface: FlinkPublishApi
      Performs 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:
      publishIndex in interface FlinkPublishApi
      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

      public void publishToBatch(BatchToken token, Iterator<CommitPartition> partitions)
      Description copied from interface: FlinkPublishApi
      Upload partitions for given commit token.

      Specified by:
      publishToBatch in interface FlinkPublishApi
      Parameters:
      token - Token retrieved from a function FlinkPublishApi.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

      public Feature putFeature(String layer, Feature feature, String featureId)
      Description copied from interface: FlinkPublishApi
      Uploads specified feature to Interactive Map layer.

      Specified by:
      putFeature in interface FlinkPublishApi
      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

      public FeatureCollection putFeatureCollection(String layer, FeatureCollection featureCollection)
      Description copied from interface: FlinkPublishApi
      Uploads specified FeatureCollection to Interactive Map layer.

      Specified by:
      putFeatureCollection in interface FlinkPublishApi
      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

      public String putFeatureCollectionJson(String layer, String featureCollection)
      Description copied from interface: FlinkPublishApi
      Uploads specified FeatureCollection to Interactive Map layer.

      Specified by:
      putFeatureCollectionJson in interface FlinkPublishApi
      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

      public String putFeatureJson(String layer, String feature, String featureId)
      Description copied from interface: FlinkPublishApi
      Uploads specified feature to Interactive Map layer.

      Specified by:
      putFeatureJson in interface FlinkPublishApi
      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: FlinkPublishApi
      Starts 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:
      startBatch2 in interface FlinkPublishApi
      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: FlinkPublishApi
      Updates an index layer by adding the additions partitions and removing removals partitions.

      Specified by:
      updateIndex in interface FlinkPublishApi
      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.