Interface ReadEngine
- All Known Implementing Classes:
ReadEngineImpl
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pekko.stream.javadsl.Flow<Partition,byte[], org.apache.pekko.NotUsed> asDataFlow(Integer parallelism) Retrieves an pekko stream Flow that download bytes for each partition.Checks if a blob exists for the requested data handle.exportIMLFeatures(String layer, OptionalInt batchSize) Exports all the features from Interactive Map Layer<A> CompletionStage<A>Retrieves the blob data associated with the partition and transform data withdataBytesInterpreterfunction<A> CompletionStage<A>get(Partition partition, org.apache.pekko.japi.function.Function<byte[], A> dataBytesInterpreter, PartitionDecoder decoder) Retrieves the blob data associated with the partition and transform data withdataBytesInterpreterfunctionCompletionStage<byte[]>getDataAsBytes(Partition partition) Retrieves the blob data associated with the partition as array of bytesCompletionStage<byte[]>getDataAsBytes(Partition partition, ByteRange range) Retrieves the blob data associated with the partition as array of bytesCompletionStage<byte[]>getDataAsBytes(Partition partition, ByteRange range, PartitionDecoder decoder) Retrieves the blob data associated with the partition as array of bytesCompletionStage<byte[]>getDataAsBytes(Partition partition, ByteRange range, PartitionDecoder decoder, boolean applyDecompression) Retrieves the blob data associated with the partition as array of bytesCompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition) Retrieves the blob data associated with the partition as sourceCompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition, ByteRange range) Retrieves the blob data associated with the partition as sourceCompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition, ByteRange range, PartitionDecoder decoder) Retrieves the blob data associated with the partition as sourceCompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition, ByteRange range, PartitionDecoder decoder, boolean applyDecompression) Retrieves the blob data associated with the partition as sourceCompletionStage<byte[]>getObjectDataAsBytes2(String layerId, String key, boolean applyDecompression, ByteRange range) Retrieves the blob data associated with provided key as an Array of bytes.CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getObjectDataAsSource2(String layerId, String key, boolean applyDecompression, ByteRange range) Retrieves the blob data associated with provided key as source.getObjectMetadata(String layerId, String key) Retrieves metadata of the key provided in requestorg.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjects(String layerId, String parent) Retrieves Source of elements under the provided parent key at one level of depth.org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjects(String layerId, String parent, Integer pageSize) Retrieves Source of elements under the provided parent key at one level of depth.listObjectsAsCollection(String layerId, String parent) Retrieves List of elements under the provided parent key at one level of depth.listObjectsAsCollection(String layerId, String parent, Integer pageSize) Retrieves List of elements under the provided parent key at one level of depth.org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjectsDeep(String layerId, String parent) Retrieves Source of elements under the provided parent key.org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjectsDeep(String layerId, String parent, Integer pageSize) Retrieves Source of elements under the provided parent key.
-
Method Details
-
asDataFlow
org.apache.pekko.stream.javadsl.Flow<Partition,byte[], asDataFloworg.apache.pekko.NotUsed> (Integer parallelism) Retrieves an pekko stream Flow that download bytes for each partition.- Parameters:
parallelism- Number of parallelism used to request data to blobstore- Returns:
- the pekko flow
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
exists
Checks if a blob exists for the requested data handle.- Parameters:
layerId- the ID of the layer that the blob belongs todataHandle- the data handle identifies a specific blob so that you can get that blob's contents- Returns:
- true, if blob exists for the requested data handle, otherwise false.
- Throws:
UnsupportedOperationException- in case method called for non-version layerDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
exportIMLFeatures
org.apache.pekko.stream.javadsl.Source<List<Feature>,org.apache.pekko.NotUsed> exportIMLFeatures(String layer, OptionalInt batchSize) Exports all the features from Interactive Map Layer- Parameters:
layer- the id of the layerbatchSize- the batch size to iterate from Interactive Map Layer- Returns:
- Source of Feature list from Interactive Map Layer
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
get
<A> CompletionStage<A> get(Partition partition, org.apache.pekko.japi.function.Function<byte[], A> dataBytesInterpreter) Retrieves the blob data associated with the partition and transform data withdataBytesInterpreterfunction- Parameters:
partition- the partition to retrievedataBytesInterpreter- function to transform blob associated with partition- Returns:
- blob data associated with the partition transformed with
dataBytesInterpreter, or an exceptional completion with a NotFoundException when the partition doesn't have associated payload (e.g. for expired volatile data) - Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
get
<A> CompletionStage<A> get(Partition partition, org.apache.pekko.japi.function.Function<byte[], A> dataBytesInterpreter, PartitionDecoder decoder) Retrieves the blob data associated with the partition and transform data withdataBytesInterpreterfunction- Parameters:
partition- the partition to retrievedataBytesInterpreter- function to transform blob associated with partitiondecoder- decodes partition data and passes it to the dataBytesInterpreter.- Returns:
- blob data associated with the partition transformed with
dataBytesInterpreter, or an exceptional completion with a NotFoundException when the partition doesn't have associated payload (e.g. for expired volatile data) - Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
getDataAsBytes
Retrieves the blob data associated with the partition as array of bytes- Parameters:
partition- the partition to retrieve- Returns:
- blob data associated with the partition as array of bytes, or an exceptional completion with a NotFoundException when the partition doesn't have associated payload (e.g. for expired volatile data)
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error- Note:
- This method could be used only for downloading data less than 2GB. In other cases {@link com.here.platform.data.client.engine.javadsl.ReadEngine.getDataAsSource(partition:com\.here\.platform\.data\.client\.javadsl\.Partition)* getDataAsSource} should be used
-
getDataAsBytes
Retrieves the blob data associated with the partition as array of bytes- Parameters:
partition- the partition to retrieverange- the range of bytes to retrieve. This parameter should be set toByteRange.all()when the specified partition is in a versioned layer with compression enabled, or when the partition is in a volatile layer.- Returns:
- blob data associated with the partition as array of bytes
- Throws:
NotFoundException- in case the partition doesn't have associated payload (e.g. for expired volatile data)DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error- Note:
- This method could be used only for downloading data less than 2GB. In other cases {@link com.here.platform.data.client.engine.javadsl.ReadEngine.getDataAsSource(partition:com\.here\.platform\.data\.client\.javadsl\.Partition,range:com\.here\.platform\.data\.client\.model\.ByteRange)* getDataAsSource} should be used
-
getDataAsBytes
CompletionStage<byte[]> getDataAsBytes(Partition partition, ByteRange range, PartitionDecoder decoder) Retrieves the blob data associated with the partition as array of bytes- Parameters:
partition- the partition to retrieverange- the range of bytes to retrieve. This parameter should be set toByteRange.all()when the specified partition is in a versioned layer with compression enabled, or when the partition is in a volatile layer.decoder- decodes partition data prior to returning.- Returns:
- blob data associated with the partition as array of bytes
- Throws:
NotFoundException- in case the partition doesn't have associated payload (e.g. for expired volatile data)DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error- Note:
- This method could be used only for downloading data less than 2GB. In other cases {@link com.here.platform.data.client.engine.javadsl.ReadEngine.getDataAsSource(partition:com\.here\.platform\.data\.client\.javadsl\.Partition,range:com\.here\.platform\.data\.client\.model\.ByteRange)* getDataAsSource} should be used
-
getDataAsBytes
CompletionStage<byte[]> getDataAsBytes(Partition partition, ByteRange range, PartitionDecoder decoder, boolean applyDecompression) Retrieves the blob data associated with the partition as array of bytes- Parameters:
partition- the partition to retrieverange- the range of bytes to retrieve. This parameter should be set toByteRange.all()when the specified partition is in a versioned layer with compression enabled, or when the partition is in a volatile layer.decoder- decodes partition data prior to returning.applyDecompression- decides whether decompression is applied for the compressed partition data.- Returns:
- blob data associated with the partition as array of bytes
- Throws:
NotFoundException- in case the partition doesn't have associated payload (e.g. for expired volatile data)DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error- Note:
- This method could be used only for downloading data less than 2GB. In other cases {@link com.here.platform.data.client.engine.javadsl.ReadEngine.getDataAsSource(partition:com\.here\.platform\.data\.client\.javadsl\.Partition,range:com\.here\.platform\.data\.client\.model\.ByteRange)* getDataAsSource} should be used
-
getDataAsSource
CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition) Retrieves the blob data associated with the partition as sourceSource returned by this function *MUST BE* consumed or cancelled. If accidentally left neither consumed or cancelled it will be assumed the incoming data should remain back-pressured, and will stall the incoming data via TCP back-pressure mechanisms. Such stall connection can exhaust DataClient connection pool.
- Parameters:
partition- the partition to retrieve- Returns:
- blob data associated with the partition as source
- Throws:
NotFoundException- in case the partition doesn't have associated payload (e.g. for expired volatile data)DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
getDataAsSource
CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition, ByteRange range) Retrieves the blob data associated with the partition as sourceSource returned by this function *MUST BE* consumed or cancelled. If accidentally left neither consumed or cancelled it will be assumed the incoming data should remain back-pressured, and will stall the incoming data via TCP back-pressure mechanisms. Such stall connection can exhaust DataClient connection pool.
- Parameters:
partition- the partition to retrieverange- the range of bytes to retrieve. This parameter should be set toByteRange.all()when the specified partition is in a versioned layer with compression enabled, or when the partition is in a volatile layer.- Returns:
- blob data associated with the partition as source
- Throws:
NotFoundException- in case the partition doesn't have associated payload (e.g. for expired volatile data)DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
getDataAsSource
CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition, ByteRange range, PartitionDecoder decoder) Retrieves the blob data associated with the partition as sourceSource returned by this function *MUST BE* consumed or cancelled. If accidentally left neither consumed or cancelled it will be assumed the incoming data should remain back-pressured, and will stall the incoming data via TCP back-pressure mechanisms. Such stall connection can exhaust DataClient connection pool.
- Parameters:
partition- the partition to retrieverange- the range of bytes to retrieve. This parameter should be set toByteRange.all()when the specified partition is in a versioned layer with compression enabled, or when the partition is in a volatile layer.decoder- adds source map that decodes partition data.- Returns:
- blob data associated with the partition as source
- Throws:
NotFoundException- in case the partition doesn't have associated payload (e.g. for expired volatile data)DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
getDataAsSource
CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition, ByteRange range, PartitionDecoder decoder, boolean applyDecompression) Retrieves the blob data associated with the partition as sourceSource returned by this function *MUST BE* consumed or cancelled. If accidentally left neither consumed or cancelled it will be assumed the incoming data should remain back-pressured, and will stall the incoming data via TCP back-pressure mechanisms. Such stall connection can exhaust DataClient connection pool.
- Parameters:
partition- the partition to retrieverange- the range of bytes to retrieve. This parameter should be set toByteRange.all()when the specified partition is in a versioned layer with compression enabled, or when the partition is in a volatile layer.decoder- adds source map that decodes partition data.applyDecompression- decides whether decompression is applied for the compressed partition data.- Returns:
- blob data associated with the partition as source
- Throws:
NotFoundException- in case the partition doesn't have associated payload (e.g. for expired volatile data)DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
getObjectDataAsBytes2
CompletionStage<byte[]> getObjectDataAsBytes2(String layerId, String key, boolean applyDecompression, ByteRange range) Retrieves the blob data associated with provided key as an Array of bytes.- Parameters:
layerId- the id of the layerkey- the key of the object to get data forapplyDecompression- decides whether decompression is applied for the object data.range- the range of bytes to retrieve- Returns:
- Blob data associated with key as an Array of bytes.
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerNotFoundException- in case of the key doesn't existDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
getObjectDataAsSource2
CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getObjectDataAsSource2(String layerId, String key, boolean applyDecompression, ByteRange range) Retrieves the blob data associated with provided key as source.- Parameters:
layerId- the id of the layerkey- the key of the object to get data forapplyDecompression- decides whether decompression is applied for the object data.range- the range of bytes to retrieve- Returns:
- Blob data associated with key as source.
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerNotFoundException- in case of the key doesn't existDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
getObjectMetadata
Retrieves metadata of the key provided in request- Parameters:
layerId- the id of the layerkey- the key for which metadata is requested- Returns:
- metadata associated with the specified key
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable errorNotFoundException- in case of the key doesn't exist
-
listObjects
org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjects(String layerId, String parent) Retrieves Source of elements under the provided parent key at one level of depth.If no parent key is provided, root of the layer is used as default key.
- Parameters:
layerId- the id of the layerparent- the key under which listing items are requested. Empty String or Null value means root is requested.- Returns:
- Source of the listing elements.
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
listObjects
org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjects(String layerId, String parent, Integer pageSize) Retrieves Source of elements under the provided parent key at one level of depth.If no parent key is provided, root of the layer is used as default key.
- Parameters:
layerId- the id of the layerparent- the key under which listing items are requested. Empty String or Null value means root is requested.pageSize- the number of objects that are fetched internally per request- Returns:
- Source of the listing elements.
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
listObjectsAsCollection
Retrieves List of elements under the provided parent key at one level of depth.If no parent key is provided, root of the layer is used as default key.
- Parameters:
layerId- the id of the layerparent- the key under which listing items are requested. Empty String or Null value means root is requested.- Returns:
- List of elements.
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
listObjectsAsCollection
CompletionStage<List<ObjectStoreListItem>> listObjectsAsCollection(String layerId, String parent, Integer pageSize) Retrieves List of elements under the provided parent key at one level of depth.If no parent key is provided, root of the layer is used as default key.
- Parameters:
layerId- the id of the layerparent- the key under which listing items are requested. Empty String or Null value means root is requested.pageSize- the number of objects that are fetched internally per request- Returns:
- List of elements.
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
listObjectsDeep
org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjectsDeep(String layerId, String parent) Retrieves Source of elements under the provided parent key. All results appear as complete objects at full depth.If no parent key is provided, root of the layer is used as default key.
- Parameters:
layerId- the id of the layerparent- the key under which listing items are requested. Empty String or Null value means root is requested.- Returns:
- Source of the listing elements.
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
listObjectsDeep
org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjectsDeep(String layerId, String parent, Integer pageSize) Retrieves Source of elements under the provided parent key. All results appear as complete objects at full depth.If no parent key is provided, root of the layer is used as default key.
- Parameters:
layerId- the id of the layerparent- the key under which listing items are requested. Empty String or Null value means root is requested.pageSize- the number of objects that are fetched internally per request- Returns:
- Source of the listing elements.
- Throws:
UnsupportedOperationException- in case method called for non-objectstore layerDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-