Package com.hazelcast.jet.protobuf
Class ProtobufSerializerHook<T extends com.google.protobuf.GeneratedMessageV3>
- java.lang.Object
-
- com.hazelcast.jet.protobuf.ProtobufSerializerHook<T>
-
- Type Parameters:
T
- the Protocol BuffersGeneratedMessageV3
type handled by thisSerializerHook
.
- All Implemented Interfaces:
SerializerHook<T>
public abstract class ProtobufSerializerHook<T extends com.google.protobuf.GeneratedMessageV3> extends java.lang.Object implements SerializerHook<T>
Simplifies using the Hazelcast Serializer Hook mechanism to register a Google Protocol Buffers serializer with the Hazelcast Jet cluster. The serialized class can then be used in Hazelcast data structures and Jet jobs.To use it, create a JAR containing the serializer hook class and
META-INF/services/com.hazelcast.SerializerHook
, a plain-text file containing its fully qualified name. Visit Jet's Serialization Guide for more details.- Since:
- Jet 4.1
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProtobufSerializerHook(java.lang.Class<T> clazz, int typeId)
Creates Protocol Buffers v3 serializer hook.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Serializer
createSerializer()
Creates a new serializer for the serialization typejava.lang.Class<T>
getSerializationType()
Returns the actual class type of the serialized objectboolean
isOverwritable()
Indicates if this serializer can be overridden by defining a custom serializer in the configurations (via code or configuration file)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hazelcast.nio.serialization.SerializerHook
createSerializer
-
-
-
-
Constructor Detail
-
ProtobufSerializerHook
protected ProtobufSerializerHook(java.lang.Class<T> clazz, int typeId)
Creates Protocol Buffers v3 serializer hook.- Parameters:
clazz
-GeneratedMessageV3
serialization type registered by this hooktypeId
- unique type id of serializer registered by this hook
-
-
Method Detail
-
getSerializationType
public java.lang.Class<T> getSerializationType()
Description copied from interface:SerializerHook
Returns the actual class type of the serialized object- Specified by:
getSerializationType
in interfaceSerializerHook<T extends com.google.protobuf.GeneratedMessageV3>
-
createSerializer
public Serializer createSerializer()
Description copied from interface:SerializerHook
Creates a new serializer for the serialization type- Specified by:
createSerializer
in interfaceSerializerHook<T extends com.google.protobuf.GeneratedMessageV3>
-
isOverwritable
public boolean isOverwritable()
Description copied from interface:SerializerHook
Indicates if this serializer can be overridden by defining a custom serializer in the configurations (via code or configuration file)- Specified by:
isOverwritable
in interfaceSerializerHook<T extends com.google.protobuf.GeneratedMessageV3>
-
-