Defines the contract of the serializers used for Compact serialization.

After defining a serializer for the objects of the class C, it can be registered using the ClientConfig.serialization.compact.serializers.

write and read methods must be consistent with each other.

Type Parameters

  • C

Hierarchy

  • CompactSerializer

Methods

  • You need to return the class constructor from this function. For example, if a class is instantiated with new Employee() class constructor is Employee. Alternatively, you can return a constructor function from this class. The function you provided will be used to check if an object is compact serializable.

    Returns

    The class or the constructor function which the serializer is written for.

    Returns Function

  • Type name is written into the serialized data and used while deserialization. This should have the same value with what other members of the cluster have. While deserializing there should be a matching serializer otherwise a GenericRecord will be returned.

    Returns

    The type name of the registered class.

    Returns string

Generated using TypeDoc