Class ReadEngineImpl
- All Implemented Interfaces:
ReadEngine,com.here.platform.data.client.javadsl.internal.Implicits
-
Constructor Summary
ConstructorsConstructorDescriptionReadEngineImpl(com.here.platform.data.client.engine.scaladsl.ReadEngine delegate) -
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.Methods 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
-
ReadEngineImpl
public ReadEngineImpl(com.here.platform.data.client.engine.scaladsl.ReadEngine delegate)
-
-
Method Details
-
asDataFlow
public org.apache.pekko.stream.javadsl.Flow<Partition,byte[], asDataFloworg.apache.pekko.NotUsed> (Integer parallelism) Description copied from interface:ReadEngineRetrieves an pekko stream Flow that download bytes for each partition.- Specified by:
asDataFlowin interfaceReadEngine- Parameters:
parallelism- Number of parallelism used to request data to blobstore- Returns:
- the pekko flow
-
exists
Description copied from interface:ReadEngineChecks if a blob exists for the requested data handle.- Specified by:
existsin interfaceReadEngine- 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.
-
exportIMLFeatures
public org.apache.pekko.stream.javadsl.Source<List<Feature>,org.apache.pekko.NotUsed> exportIMLFeatures(String layer, OptionalInt batchSize) Description copied from interface:ReadEngineExports all the features from Interactive Map Layer- Specified by:
exportIMLFeaturesin interfaceReadEngine- 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
-
get
public <A> CompletionStage<A> get(Partition partition, org.apache.pekko.japi.function.Function<byte[], A> dataBytesInterpreter) Description copied from interface:ReadEngineRetrieves the blob data associated with the partition and transform data withdataBytesInterpreterfunction- Specified by:
getin interfaceReadEngine- 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)
-
get
public <A> CompletionStage<A> get(Partition partition, org.apache.pekko.japi.function.Function<byte[], A> dataBytesInterpreter, PartitionDecoder decoder) Description copied from interface:ReadEngineRetrieves the blob data associated with the partition and transform data withdataBytesInterpreterfunction- Specified by:
getin interfaceReadEngine- 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)
-
getDataAsBytes
Description copied from interface:ReadEngineRetrieves the blob data associated with the partition as array of bytes- Specified by:
getDataAsBytesin interfaceReadEngine- 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)
-
getDataAsBytes
Description copied from interface:ReadEngineRetrieves the blob data associated with the partition as array of bytes- Specified by:
getDataAsBytesin interfaceReadEngine- 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
-
getDataAsBytes
public CompletionStage<byte[]> getDataAsBytes(Partition partition, ByteRange range, PartitionDecoder decoder) Description copied from interface:ReadEngineRetrieves the blob data associated with the partition as array of bytes- Specified by:
getDataAsBytesin interfaceReadEngine- 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
-
getDataAsBytes
public CompletionStage<byte[]> getDataAsBytes(Partition partition, ByteRange range, PartitionDecoder decoder, boolean applyDecompression) Description copied from interface:ReadEngineRetrieves the blob data associated with the partition as array of bytes- Specified by:
getDataAsBytesin interfaceReadEngine- 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
-
getDataAsSource
public CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
getDataAsSourcein interfaceReadEngine- Parameters:
partition- the partition to retrieve- Returns:
- blob data associated with the partition as source
-
getDataAsSource
public CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition, ByteRange range) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
getDataAsSourcein interfaceReadEngine- 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
-
getDataAsSource
public CompletionStage<org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>> getDataAsSource(Partition partition, ByteRange range, PartitionDecoder decoder) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
getDataAsSourcein interfaceReadEngine- 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
-
getDataAsSource
public 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) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
getDataAsSourcein interfaceReadEngine- 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
-
getObjectDataAsBytes2
public CompletionStage<byte[]> getObjectDataAsBytes2(String layerId, String key, boolean applyDecompression, ByteRange range) Description copied from interface:ReadEngineRetrieves the blob data associated with provided key as an Array of bytes.- Specified by:
getObjectDataAsBytes2in interfaceReadEngine- 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.
-
getObjectDataAsSource2
public 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) Description copied from interface:ReadEngineRetrieves the blob data associated with provided key as source.- Specified by:
getObjectDataAsSource2in interfaceReadEngine- 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.
-
getObjectMetadata
Description copied from interface:ReadEngineRetrieves metadata of the key provided in request- Specified by:
getObjectMetadatain interfaceReadEngine- Parameters:
layerId- the id of the layerkey- the key for which metadata is requested- Returns:
- metadata associated with the specified key
-
listObjects
public org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjects(String layerId, String parent) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
listObjectsin interfaceReadEngine- 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.
-
listObjects
public org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjects(String layerId, String parent, Integer pageSize) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
listObjectsin interfaceReadEngine- 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.
-
listObjectsAsCollection
public CompletionStage<List<ObjectStoreListItem>> listObjectsAsCollection(String layerId, String parent) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
listObjectsAsCollectionin interfaceReadEngine- 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.
-
listObjectsAsCollection
public CompletionStage<List<ObjectStoreListItem>> listObjectsAsCollection(String layerId, String parent, Integer pageSize) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
listObjectsAsCollectionin interfaceReadEngine- 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.
-
listObjectsDeep
public org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjectsDeep(String layerId, String parent) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
listObjectsDeepin interfaceReadEngine- 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.
-
listObjectsDeep
public org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjectsDeep(String layerId, String parent, Integer pageSize) Description copied from interface:ReadEngineRetrieves 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.
- Specified by:
listObjectsDeepin interfaceReadEngine- 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.
-