Class ProtobufSerializer<T extends com.google.protobuf.GeneratedMessageV3>

java.lang.Object
com.hazelcast.jet.protobuf.ProtobufSerializer<T>
Type Parameters:
T - the Protocol Buffers GeneratedMessageV3 type handled by this StreamSerializer.
All Implemented Interfaces:
Serializer, StreamSerializer<T>

public abstract class ProtobufSerializer<T extends com.google.protobuf.GeneratedMessageV3> extends Object implements StreamSerializer<T>
Adapts a generated Google Protocol Buffers v3 serializer class to the Hazelcast StreamSerializer interface.

To learn how to use this class, visit Jet's Serialization Guide. In brief, you should create a subclass that does nothing else but call this class's protected constructor, and then you can use it in two ways:

  1. Register it as a Jet job serializer: jobConfig.registerSerializer(MyType.class, MyTypeSerializer.class).
  2. Register it with the Jet cluster through a matching implementation of ProtobufSerializerHook
Since:
Jet 4.1
  • Constructor Details

    • ProtobufSerializer

      protected ProtobufSerializer(@Nonnull Class<T> clazz, int typeId)
      Called by the subclass to initialize this protobuf serializer.
      Parameters:
      clazz - GeneratedMessageV3 type handled by this serializer
      typeId - unique type ID of this serializer
  • Method Details