Class ProtobufPartitionConverter

java.lang.Object
com.here.platform.data.client.converters.ProtobufPartitionConverter
All Implemented Interfaces:
PartitionConverter, PartitionDecoder, PartitionEncoder, Serializable

public class ProtobufPartitionConverter extends Object implements PartitionConverter
Encodes and decodes Partition data using ProtobufBlobConverter. param: getPartitionDescriptorHolder Function that returns a PartitionDescriptionHolder for the given layer ID.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProtobufPartitionConverter(scala.Function1<String,PartitionDescriptorHolder> getPartitionDescriptorHolder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(HRN hrn, Settings settings, org.apache.pekko.actor.ActorSystem actorSystem, org.apache.pekko.stream.Materializer materializer, scala.concurrent.ExecutionContext executionContext)
    Returns ProtobufPartitionConverter.
    apply(File schemaZip)
    Returns ProtobufPartitionConverter.
    byte[]
    decode(com.here.platform.data.client.scaladsl.Partition partition, byte[] data)
    Decodes partition data from Protocol buffers to a byte array representing a JSON string.
    org.apache.pekko.stream.scaladsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed>
    decode(com.here.platform.data.client.scaladsl.Partition partition, org.apache.pekko.stream.scaladsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed> bytesSource, scala.concurrent.ExecutionContext ctx, org.apache.pekko.stream.Materializer materializer)
     
    com.here.platform.data.client.scaladsl.NewPartition
    encode(com.here.platform.data.client.scaladsl.NewPartition partition)
    Encodes partition data from a BufferedBlob representing a JSON string to Protocol buffers.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • apply

      public static ProtobufPartitionConverter apply(HRN hrn, Settings settings, org.apache.pekko.actor.ActorSystem actorSystem, org.apache.pekko.stream.Materializer materializer, scala.concurrent.ExecutionContext executionContext)
      Returns ProtobufPartitionConverter.
      Parameters:
      hrn - Catalog HRN.
      actorSystem - Pekko actor system.
      materializer - Pekko stream materializer.
      executionContext - Scala ExecutionContext.
      Returns:
      ProtobufPartitionConverter.
    • apply

      public static ProtobufPartitionConverter apply(File schemaZip)
      Returns ProtobufPartitionConverter.
      Parameters:
      schemaZip - Protocol buffer schema zip file.
      Returns:
      ProtobufPartitionConverter.
    • decode

      public byte[] decode(com.here.platform.data.client.scaladsl.Partition partition, byte[] data)
      Decodes partition data from Protocol buffers to a byte array representing a JSON string.
      Specified by:
      decode in interface PartitionDecoder
      Parameters:
      partition - Partition containing the data to be decoded
      data - Protocol buffer data to be decoded
      Returns:
      Decoded JSON string as byte array.
    • decode

      public org.apache.pekko.stream.scaladsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed> decode(com.here.platform.data.client.scaladsl.Partition partition, org.apache.pekko.stream.scaladsl.Source<org.apache.pekko.util.ByteString,org.apache.pekko.NotUsed> bytesSource, scala.concurrent.ExecutionContext ctx, org.apache.pekko.stream.Materializer materializer)
      Specified by:
      decode in interface PartitionDecoder
    • encode

      public com.here.platform.data.client.scaladsl.NewPartition encode(com.here.platform.data.client.scaladsl.NewPartition partition)
      Encodes partition data from a BufferedBlob representing a JSON string to Protocol buffers.
      Specified by:
      encode in interface PartitionEncoder
      Parameters:
      partition - Partition containing data to be encoded.
      Returns:
      NewPartition with Protocol buffer encoded data.