Interface ReadEngine

All Known Implementing Classes:
ReadEngineImpl

public interface ReadEngine
Engine supporting read operations against the underlying volume.
  • Method Details

    • asDataFlow

      org.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.

      Parameters:
      parallelism - Number of parallelism used to request data to blobstore
      Returns:
      the pekko flow
      Throws:
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - in case of retriable error
    • exists

      CompletionStage<Object> exists(String layerId, String dataHandle)
      Checks if a blob exists for the requested data handle.

      Parameters:
      layerId - the ID of the layer that the blob belongs to
      dataHandle - 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 layer
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - 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 layer
      batchSize - 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 error
      DataClientRetriableException - 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 with dataBytesInterpreter function

      Parameters:
      partition - the partition to retrieve
      dataBytesInterpreter - 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 error
      DataClientRetriableException - 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 with dataBytesInterpreter function

      Parameters:
      partition - the partition to retrieve
      dataBytesInterpreter - function to transform blob associated with partition
      decoder - 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 error
      DataClientRetriableException - in case of retriable error
    • getDataAsBytes

      CompletionStage<byte[]> getDataAsBytes(Partition partition)
      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 error
      DataClientRetriableException - 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

      CompletionStage<byte[]> getDataAsBytes(Partition partition, ByteRange range)
      Retrieves the blob data associated with the partition as array of bytes

      Parameters:
      partition - the partition to retrieve
      range - the range of bytes to retrieve. This parameter should be set to ByteRange.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 error
      DataClientRetriableException - 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 retrieve
      range - the range of bytes to retrieve. This parameter should be set to ByteRange.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 error
      DataClientRetriableException - 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 retrieve
      range - the range of bytes to retrieve. This parameter should be set to ByteRange.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 error
      DataClientRetriableException - 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 source

      Source 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 error
      DataClientRetriableException - 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 source

      Source 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
      range - the range of bytes to retrieve. This parameter should be set to ByteRange.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 error
      DataClientRetriableException - 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 source

      Source 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
      range - the range of bytes to retrieve. This parameter should be set to ByteRange.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 error
      DataClientRetriableException - 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 source

      Source 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
      range - the range of bytes to retrieve. This parameter should be set to ByteRange.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 error
      DataClientRetriableException - 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 layer
      key - the key of the object to get data for
      applyDecompression - 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 layer
      NotFoundException - in case of the key doesn't exist
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - 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 layer
      key - the key of the object to get data for
      applyDecompression - 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 layer
      NotFoundException - in case of the key doesn't exist
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - in case of retriable error
    • getObjectMetadata

      CompletionStage<ObjectMetadata> getObjectMetadata(String layerId, String key)
      Retrieves metadata of the key provided in request

      Parameters:
      layerId - the id of the layer
      key - the key for which metadata is requested
      Returns:
      metadata associated with the specified key
      Throws:
      UnsupportedOperationException - in case method called for non-objectstore layer
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - in case of retriable error
      NotFoundException - 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 layer
      parent - 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 layer
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - 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 layer
      parent - 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 layer
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - in case of retriable error
    • listObjectsAsCollection

      CompletionStage<List<ObjectStoreListItem>> listObjectsAsCollection(String layerId, String parent)
      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 layer
      parent - 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 layer
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - 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 layer
      parent - 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 layer
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - 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 layer
      parent - 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 layer
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - 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 layer
      parent - 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 layer
      DataClientNonRetriableException - in case of non-retriable error
      DataClientRetriableException - in case of retriable error