Class ProtobufPartitionConverter
java.lang.Object
com.here.platform.data.client.converters.ProtobufPartitionConverter
- All Implemented Interfaces:
PartitionConverter,PartitionDecoder,PartitionEncoder,Serializable
Encodes and decodes Partition data using
ProtobufBlobConverter.
param: getPartitionDescriptorHolder Function that returns a PartitionDescriptionHolder for the given layer ID.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProtobufPartitionConverter(scala.Function1<String, PartitionDescriptorHolder> getPartitionDescriptorHolder) -
Method Summary
Modifier and TypeMethodDescriptionstatic ProtobufPartitionConverterapply(HRN hrn, Settings settings, org.apache.pekko.actor.ActorSystem actorSystem, org.apache.pekko.stream.Materializer materializer, scala.concurrent.ExecutionContext executionContext) Returns ProtobufPartitionConverter.static ProtobufPartitionConverterReturns 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.NewPartitionencode(com.here.platform.data.client.scaladsl.NewPartition partition) Encodes partition data from a BufferedBlob representing a JSON string to Protocol buffers.
-
Constructor Details
-
ProtobufPartitionConverter
public ProtobufPartitionConverter(scala.Function1<String, PartitionDescriptorHolder> getPartitionDescriptorHolder)
-
-
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
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:
decodein interfacePartitionDecoder- Parameters:
partition- Partition containing the data to be decodeddata- 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:
decodein interfacePartitionDecoder
-
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:
encodein interfacePartitionEncoder- Parameters:
partition- Partition containing data to be encoded.- Returns:
- NewPartition with Protocol buffer encoded data.
-