Class WriteEngineImpl
- All Implemented Interfaces:
WriteEngine,com.here.platform.data.client.javadsl.internal.Implicits
-
Constructor Summary
ConstructorsConstructorDescriptionWriteEngineImpl(com.here.platform.data.client.engine.scaladsl.WriteEngine delegate) -
Method Summary
Modifier and TypeMethodDescriptionblobChecksum(String layer, NewPartition.BufferedBlob blob) Computes a blob's checksum based on its layer configuration.blobCrc(String layer, NewPartition.BufferedBlob blob) Computes a blob's crc based on its layer configuration.CompletionStage<org.apache.pekko.Done>completeObjectUpload(String layerId, String key, String multipartToken, ObjectStoreUploadResult parts) Complete multi-part upload for object in objectstoreCompletionStage<org.apache.pekko.Done>copyObject(String layerId, String key, String sourceKey) Copies object from one location to otherCompletionStage<org.apache.pekko.Done>deleteObject(String layerId, String key) Deletes the specified object from object store.CompletionStage<org.apache.pekko.Done>publish(Iterator<? extends PendingPartition> partitions) Publish new partitions to a catalog.CompletionStage<org.apache.pekko.Done>publish(org.apache.pekko.stream.javadsl.Source<PendingPartition, org.apache.pekko.NotUsed> partitions) Publish new partitions to a catalog.CompletionStage<org.apache.pekko.Done>publish(org.apache.pekko.stream.javadsl.Source<PendingPartition, org.apache.pekko.NotUsed> partitions, PartitionEncoder encoder) Publish new partitions to a catalog.CompletionStage<org.apache.pekko.Done>publishBatch2(int parallelism, Optional<List<String>> layerIds, List<VersionDependency> dependencies, Iterator<? extends PendingPartition> partitions) Performs new batch publication to a catalog.CompletionStage<org.apache.pekko.Done>publishBatch2(int parallelism, Optional<List<String>> layerIds, List<VersionDependency> dependencies, org.apache.pekko.stream.javadsl.Source<PendingPartition, org.apache.pekko.NotUsed> partitions) Performs new batch publication to a catalog.CompletionStage<org.apache.pekko.Done>publishBatch2(int parallelism, Optional<List<String>> layerIds, List<VersionDependency> dependencies, org.apache.pekko.stream.javadsl.Source<PendingPartition, org.apache.pekko.NotUsed> partitions, PartitionEncoder encoder) Performs new batch publication to a catalog.put(PendingPartition partition) Adds the selected partition to the underlying blob service.put(PendingPartition partition, PartitionEncoder encoder) Adds the selected partition to the underlying blob service.CompletionStage<org.apache.pekko.Done>simpleUploadObject2(String layerId, String key, org.apache.pekko.util.ByteString data, Optional<String> contentType, Optional<ContentEncoding> contentEncoding) Upload object to objectstore in single requeststartUploadObject2(String layerId, String key, Optional<String> contentType, Optional<ContentEncoding> contentEncoding) Start multi-part upload for object in objectstoreCompletionStage<org.apache.pekko.Done>updateObjectTtl(String layerId, String key, long ttlSeconds) Updates the TTL for the object stored in Volatile LayerCompletionStage<org.apache.pekko.Done>uploadAndIndex(Iterator<NewPartition> partitions) Uploads the specified index partition to the underlying to blob service, and indexes it with specified fields in index layer.CompletionStage<org.apache.pekko.Done>uploadAndIndex(org.apache.pekko.stream.javadsl.Source<NewPartition, org.apache.pekko.NotUsed> partitions) Uploads the specified index partition to the underlying to blob service, and indexes it with specified fields in index layer.CompletionStage<org.apache.pekko.Done>uploadIMLFeatureCollection(String layer, FeatureCollection featureCollection, OptionalInt batchSize) Upload a large FeatureCollection to the Interactive Map LayeruploadIMLFeatureModificationList(String layer, FeatureModificationList featureModificationList) Uploads a FeatureModificationList to the Interactive Map LayerCompletionStage<org.apache.pekko.Done>uploadIMLFeaturesAsSource(String layer, org.apache.pekko.stream.javadsl.Source<Feature, org.apache.pekko.NotUsed> features, OptionalInt batchSize) Upload features to the Interactive Map LayerCompletionStage<org.apache.pekko.Done>uploadObject(String layerId, String key, com.here.platform.data.client.scaladsl.NewPartition.Blob blob) Uploads the specified object to object storeCompletionStage<org.apache.pekko.Done>uploadObject2(String layerId, String key, com.here.platform.data.client.scaladsl.NewPartition.Blob blob, Optional<String> contentType, Optional<ContentEncoding> contentEncoding) Uploads the specified object to object storeuploadObjectPart(String layerId, String multipartToken, int partIndex, org.apache.pekko.util.ByteString data) Upload part of object in objectstoreMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.here.platform.data.client.javadsl.internal.Implicits
completionStageCovariant, javaModelIsScalaModel
-
Constructor Details
-
WriteEngineImpl
public WriteEngineImpl(com.here.platform.data.client.engine.scaladsl.WriteEngine delegate)
-
-
Method Details
-
blobChecksum
Description copied from interface:WriteEngineComputes a blob's checksum based on its layer configuration.The algorithm used is defined accordingly to the layer's configuration. If the layer doesn't have the respective field set, then an empty optional is returned.
- Specified by:
blobChecksumin interfaceWriteEngine- Parameters:
layer- the layer that the specified blob is associated to.blob- the blob that will have its checksum computed.- Returns:
- a checksum or empty if the layer's configuration field is not set.
-
blobCrc
Description copied from interface:WriteEngineComputes a blob's crc based on its layer configuration.The algorithm used is defined accordingly to the layer's configuration. If the layer doesn't have the respective field set, then an empty optional is returned.
- Specified by:
blobCrcin interfaceWriteEngine- Parameters:
layer- the layer that the specified blob is associated to.blob- the blob that will have its crc computed.- Returns:
- a crc or empty if the layer's configuration field is not set.
-
completeObjectUpload
public CompletionStage<org.apache.pekko.Done> completeObjectUpload(String layerId, String key, String multipartToken, ObjectStoreUploadResult parts) Description copied from interface:WriteEngineComplete multi-part upload for object in objectstore- Specified by:
completeObjectUploadin interfaceWriteEngine- Parameters:
layerId- the id of the layerkey- the key of the object to be uploadedmultipartToken- the the token of the multi-part processparts- the information of all the parts uploaded- Returns:
- future which completes when blob copy request is sent to server.
-
copyObject
public CompletionStage<org.apache.pekko.Done> copyObject(String layerId, String key, String sourceKey) Description copied from interface:WriteEngineCopies object from one location to other- Specified by:
copyObjectin interfaceWriteEngine- Parameters:
layerId- the id of the layerkey- the key of the destination objectsourceKey- the key of the source object- Returns:
- future which completes when blob copy request is sent to server.
-
deleteObject
Description copied from interface:WriteEngineDeletes the specified object from object store.- Specified by:
deleteObjectin interfaceWriteEngine- Parameters:
layerId- the id of the layerkey- the key of the object to be deleted- Returns:
- future which completes when blob deletion request is sent to server.
-
publish
public CompletionStage<org.apache.pekko.Done> publish(Iterator<? extends PendingPartition> partitions) Description copied from interface:WriteEnginePublish new partitions to a catalog.This method can be used to publish new partitions to stream layer.
- Specified by:
publishin interfaceWriteEngine- Parameters:
partitions- partitions to publish.- Returns:
- future which completes when all partitions are published to server.
-
publish
public CompletionStage<org.apache.pekko.Done> publish(org.apache.pekko.stream.javadsl.Source<PendingPartition, org.apache.pekko.NotUsed> partitions) Description copied from interface:WriteEnginePublish new partitions to a catalog.This method can be used to publish new partitions to stream layer.
- Specified by:
publishin interfaceWriteEngine- Parameters:
partitions- partitions to publish.- Returns:
- future which completes when all partitions are published to server.
-
publish
public CompletionStage<org.apache.pekko.Done> publish(org.apache.pekko.stream.javadsl.Source<PendingPartition, org.apache.pekko.NotUsed> partitions, PartitionEncoder encoder) Description copied from interface:WriteEnginePublish new partitions to a catalog.This method can be used to publish new partitions to stream layer.
- Specified by:
publishin interfaceWriteEngine- Parameters:
partitions- partitions to publish.encoder- encodes partition data before adding.- Returns:
- future which completes when all partitions are published to server.
-
publishBatch2
public CompletionStage<org.apache.pekko.Done> publishBatch2(int parallelism, Optional<List<String>> layerIds, List<VersionDependency> dependencies, Iterator<? extends PendingPartition> partitions) Description copied from interface:WriteEnginePerforms new batch publication to a catalog.This call is identical invoking put for each partitions and later uploading metadata with PublishApi.startBatch2 + PublishApi.publishToBatch + PublishApi.completeBatch
Please note that there can only be one active publication at a time per versioned layer.- Specified by:
publishBatch2in interfaceWriteEngine- Parameters:
parallelism- define number of parallel operations to upload data to blob service. Optimal value depends on node configuration, RAM, CPU, network, recommended value <= 100 parallel operations. Too high parallelism affecting performance in negative way.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.- Returns:
- future which completes when publication is fully processed by server and new version is published to catalog.
-
publishBatch2
public CompletionStage<org.apache.pekko.Done> publishBatch2(int parallelism, Optional<List<String>> layerIds, List<VersionDependency> dependencies, org.apache.pekko.stream.javadsl.Source<PendingPartition, org.apache.pekko.NotUsed> partitions) Description copied from interface:WriteEnginePerforms new batch publication to a catalog.This call is identical invoking put for each partitions and later uploading metadata with PublishApi.startBatch2 + PublishApi.publishToBatch + PublishApi.completeBatch
Please note that there can only be one active publication at a time per versioned layer.- Specified by:
publishBatch2in interfaceWriteEngine- Parameters:
parallelism- define number of parallel operations to upload data to blob service. Optimal value depends on node configuration, RAM, CPU, network, recommended value <= 100 parallel operations. Too high parallelism affecting performance in negative way.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.- Returns:
- future which completes when publication is fully processed by server and new version is published to catalog.
-
publishBatch2
public CompletionStage<org.apache.pekko.Done> publishBatch2(int parallelism, Optional<List<String>> layerIds, List<VersionDependency> dependencies, org.apache.pekko.stream.javadsl.Source<PendingPartition, org.apache.pekko.NotUsed> partitions, PartitionEncoder encoder) Description copied from interface:WriteEnginePerforms new batch publication to a catalog.This call is identical invoking put for each partitions and later uploading metadata with PublishApi.startBatch2 + PublishApi.publishToBatch + PublishApi.completeBatch
Please note that there can only be one active publication at a time per versioned layer.- Specified by:
publishBatch2in interfaceWriteEngine- Parameters:
parallelism- define number of parallel operations to upload data to blob service. Optimal value depends on node configuration, RAM, CPU, network, recommended value <= 100 parallel operations. Too high parallelism affecting performance in negative way.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.encoder- encodes partition data before adding.- Returns:
- future which completes when publication is fully processed by server and new version is published to catalog.
-
put
Description copied from interface:WriteEngineAdds the selected partition to the underlying blob service.- Specified by:
putin interfaceWriteEngine- Parameters:
partition- the partition to add- Returns:
- future which completes when all data was sent to publish service.
-
put
Description copied from interface:WriteEngineAdds the selected partition to the underlying blob service.- Specified by:
putin interfaceWriteEngine- Parameters:
partition- the partition to addencoder- encodes partition data before adding.- Returns:
- future which completes when all data was sent to publish service.
-
simpleUploadObject2
public CompletionStage<org.apache.pekko.Done> simpleUploadObject2(String layerId, String key, org.apache.pekko.util.ByteString data, Optional<String> contentType, Optional<ContentEncoding> contentEncoding) Description copied from interface:WriteEngineUpload object to objectstore in single requestNOTE: This function simply uploads 1:1 to object store without any fancy logic. For most use cases we suggest to rather use function
uploadObject2. This function does *NOT* - split large files in smaller upload pieces (more error prone) - automatically gzip (means if you define contentEncoding = ContentEncoding.gzip then you need to make sure your data is already gzipped; if not it will lead to an error when you try to read it later or want to see it in HERE platform portal)- Specified by:
simpleUploadObject2in interfaceWriteEngine- Parameters:
layerId- the id of the layerkey- the key of the object to be uploadeddata- the data of the object to be uploaded- Returns:
- future which completes when blob copy request is sent to server.
-
startUploadObject2
public CompletionStage<ObjectMultipartToken> startUploadObject2(String layerId, String key, Optional<String> contentType, Optional<ContentEncoding> contentEncoding) Description copied from interface:WriteEngineStart multi-part upload for object in objectstore- Specified by:
startUploadObject2in interfaceWriteEngine- Parameters:
layerId- the id of the layerkey- the key of the object to be uploaded- Returns:
- future which completes when blob copy request is sent to server.
-
updateObjectTtl
public CompletionStage<org.apache.pekko.Done> updateObjectTtl(String layerId, String key, long ttlSeconds) Description copied from interface:WriteEngineUpdates the TTL for the object stored in Volatile Layer- Specified by:
updateObjectTtlin interfaceWriteEngine- Parameters:
layerId- the id of the layerkey- the key of the target objectttlSeconds- new value of ttl for the object- Returns:
- future which completes when server update request is sent to server.
-
uploadAndIndex
Description copied from interface:WriteEngineUploads the specified index partition to the underlying to blob service, and indexes it with specified fields in index layer.- Specified by:
uploadAndIndexin interfaceWriteEngine- Parameters:
partitions- the partitions to upload and to index- Returns:
- future which completes when partition are published to server.
-
uploadAndIndex
public CompletionStage<org.apache.pekko.Done> uploadAndIndex(org.apache.pekko.stream.javadsl.Source<NewPartition, org.apache.pekko.NotUsed> partitions) Description copied from interface:WriteEngineUploads the specified index partition to the underlying to blob service, and indexes it with specified fields in index layer.- Specified by:
uploadAndIndexin interfaceWriteEngine- Parameters:
partitions- the partitions to upload and to index- Returns:
- future which completes when partition are published to server.
-
uploadIMLFeatureCollection
public CompletionStage<org.apache.pekko.Done> uploadIMLFeatureCollection(String layer, FeatureCollection featureCollection, OptionalInt batchSize) Description copied from interface:WriteEngineUpload a large FeatureCollection to the Interactive Map Layer- Specified by:
uploadIMLFeatureCollectionin interfaceWriteEngine- Parameters:
layer- the id of the layerfeatureCollection- the FeatureCollection to uploadbatchSize- the number of features in an upload batch
-
uploadIMLFeatureModificationList
public CompletionStage<FeatureCollection> uploadIMLFeatureModificationList(String layer, FeatureModificationList featureModificationList) Description copied from interface:WriteEngineUploads a FeatureModificationList to the Interactive Map Layer- Specified by:
uploadIMLFeatureModificationListin interfaceWriteEngine- Parameters:
layer- the id of the layerfeatureModificationList- the FeatureModificationList to upload
-
uploadIMLFeaturesAsSource
public CompletionStage<org.apache.pekko.Done> uploadIMLFeaturesAsSource(String layer, org.apache.pekko.stream.javadsl.Source<Feature, org.apache.pekko.NotUsed> features, OptionalInt batchSize) Description copied from interface:WriteEngineUpload features to the Interactive Map Layer- Specified by:
uploadIMLFeaturesAsSourcein interfaceWriteEngine- Parameters:
layer- the id of the layerfeatures- source of features to be uploadedbatchSize- the number of features in an upload batch
-
uploadObject
public CompletionStage<org.apache.pekko.Done> uploadObject(String layerId, String key, com.here.platform.data.client.scaladsl.NewPartition.Blob blob) Description copied from interface:WriteEngineUploads the specified object to object store- Specified by:
uploadObjectin interfaceWriteEngine- Parameters:
layerId- the id of the layerkey- the key of the object to be uploadedblob- he blob of data that is to be uploaded- Returns:
- future which completes when the data blob is uploaded to the server.
-
uploadObject2
public CompletionStage<org.apache.pekko.Done> uploadObject2(String layerId, String key, com.here.platform.data.client.scaladsl.NewPartition.Blob blob, Optional<String> contentType, Optional<ContentEncoding> contentEncoding) Description copied from interface:WriteEngineUploads the specified object to object store- Specified by:
uploadObject2in interfaceWriteEngine- Parameters:
layerId- the id of the layerkey- the key of the object to be uploadedblob- the blob of data that is to be uploadedcontentType- the contentType of the data that is to be uploaded. This field is optional. Its default value is application/octet-stream.contentEncoding- the contentEncoding of the data that is to be uploaded.This field is optional.- Returns:
- future which completes when the data blob is uploaded to the server.
-
uploadObjectPart
public CompletionStage<ObjectUploadPart> uploadObjectPart(String layerId, String multipartToken, int partIndex, org.apache.pekko.util.ByteString data) Description copied from interface:WriteEngineUpload part of object in objectstore- Specified by:
uploadObjectPartin interfaceWriteEngine- Parameters:
layerId- the id of the layermultipartToken- token of the multipart processpartIndex- the number of partdata- the data of part to be uploaded- Returns:
- future which completes when blob copy request is sent to server.
-