Class ReadEngineImpl

java.lang.Object
com.here.platform.data.client.engine.javadsl.ReadEngineImpl
All Implemented Interfaces:
ReadEngine, com.here.platform.data.client.javadsl.internal.Implicits

public final class ReadEngineImpl extends Object implements ReadEngine, com.here.platform.data.client.javadsl.internal.Implicits
  • 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[],org.apache.pekko.NotUsed> asDataFlow(Integer parallelism)
      Description copied from interface: ReadEngine
      Retrieves an pekko stream Flow that download bytes for each partition.

      Specified by:
      asDataFlow in interface ReadEngine
      Parameters:
      parallelism - Number of parallelism used to request data to blobstore
      Returns:
      the pekko flow
    • exists

      public CompletionStage<Object> exists(String layerId, String dataHandle)
      Description copied from interface: ReadEngine
      Checks if a blob exists for the requested data handle.

      Specified by:
      exists in interface ReadEngine
      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.
    • exportIMLFeatures

      public org.apache.pekko.stream.javadsl.Source<List<Feature>,org.apache.pekko.NotUsed> exportIMLFeatures(String layer, OptionalInt batchSize)
      Description copied from interface: ReadEngine
      Exports all the features from Interactive Map Layer
      Specified by:
      exportIMLFeatures in interface ReadEngine
      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
    • get

      public <A> CompletionStage<A> get(Partition partition, org.apache.pekko.japi.function.Function<byte[],A> dataBytesInterpreter)
      Description copied from interface: ReadEngine
      Retrieves the blob data associated with the partition and transform data with dataBytesInterpreter function

      Specified by:
      get in interface ReadEngine
      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)
    • get

      public <A> CompletionStage<A> get(Partition partition, org.apache.pekko.japi.function.Function<byte[],A> dataBytesInterpreter, PartitionDecoder decoder)
      Description copied from interface: ReadEngine
      Retrieves the blob data associated with the partition and transform data with dataBytesInterpreter function

      Specified by:
      get in interface ReadEngine
      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)
    • getDataAsBytes

      public CompletionStage<byte[]> getDataAsBytes(Partition partition)
      Description copied from interface: ReadEngine
      Retrieves the blob data associated with the partition as array of bytes

      Specified by:
      getDataAsBytes in interface ReadEngine
      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

      public CompletionStage<byte[]> getDataAsBytes(Partition partition, ByteRange range)
      Description copied from interface: ReadEngine
      Retrieves the blob data associated with the partition as array of bytes

      Specified by:
      getDataAsBytes in interface ReadEngine
      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
    • getDataAsBytes

      public CompletionStage<byte[]> getDataAsBytes(Partition partition, ByteRange range, PartitionDecoder decoder)
      Description copied from interface: ReadEngine
      Retrieves the blob data associated with the partition as array of bytes

      Specified by:
      getDataAsBytes in interface ReadEngine
      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
    • getDataAsBytes

      public CompletionStage<byte[]> getDataAsBytes(Partition partition, ByteRange range, PartitionDecoder decoder, boolean applyDecompression)
      Description copied from interface: ReadEngine
      Retrieves the blob data associated with the partition as array of bytes

      Specified by:
      getDataAsBytes in interface ReadEngine
      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
    • 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: ReadEngine
      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.

      Specified by:
      getDataAsSource in interface ReadEngine
      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: ReadEngine
      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.

      Specified by:
      getDataAsSource in interface ReadEngine
      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
    • 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: ReadEngine
      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.

      Specified by:
      getDataAsSource in interface ReadEngine
      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
    • 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: ReadEngine
      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.

      Specified by:
      getDataAsSource in interface ReadEngine
      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
    • getObjectDataAsBytes2

      public CompletionStage<byte[]> getObjectDataAsBytes2(String layerId, String key, boolean applyDecompression, ByteRange range)
      Description copied from interface: ReadEngine
      Retrieves the blob data associated with provided key as an Array of bytes.

      Specified by:
      getObjectDataAsBytes2 in interface ReadEngine
      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.
    • 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: ReadEngine
      Retrieves the blob data associated with provided key as source.

      Specified by:
      getObjectDataAsSource2 in interface ReadEngine
      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.
    • getObjectMetadata

      public CompletionStage<ObjectMetadata> getObjectMetadata(String layerId, String key)
      Description copied from interface: ReadEngine
      Retrieves metadata of the key provided in request

      Specified by:
      getObjectMetadata in interface ReadEngine
      Parameters:
      layerId - the id of the layer
      key - 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: ReadEngine
      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.

      Specified by:
      listObjects in interface ReadEngine
      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.
    • listObjects

      public org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjects(String layerId, String parent, Integer pageSize)
      Description copied from interface: ReadEngine
      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.

      Specified by:
      listObjects in interface ReadEngine
      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.
    • listObjectsAsCollection

      public CompletionStage<List<ObjectStoreListItem>> listObjectsAsCollection(String layerId, String parent)
      Description copied from interface: ReadEngine
      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.

      Specified by:
      listObjectsAsCollection in interface ReadEngine
      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.
    • listObjectsAsCollection

      public CompletionStage<List<ObjectStoreListItem>> listObjectsAsCollection(String layerId, String parent, Integer pageSize)
      Description copied from interface: ReadEngine
      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.

      Specified by:
      listObjectsAsCollection in interface ReadEngine
      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.
    • listObjectsDeep

      public org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjectsDeep(String layerId, String parent)
      Description copied from interface: ReadEngine
      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.

      Specified by:
      listObjectsDeep in interface ReadEngine
      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.
    • listObjectsDeep

      public org.apache.pekko.stream.javadsl.Source<ObjectStoreListItem,org.apache.pekko.NotUsed> listObjectsDeep(String layerId, String parent, Integer pageSize)
      Description copied from interface: ReadEngine
      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.

      Specified by:
      listObjectsDeep in interface ReadEngine
      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.