Class SessionWindowedSerializer<T>

java.lang.Object
org.apache.kafka.streams.kstream.SessionWindowedSerializer<T>
All Implemented Interfaces:
Closeable, AutoCloseable, Serializer<Windowed<T>>, org.apache.kafka.streams.kstream.internals.WindowedSerializer<T>

public class SessionWindowedSerializer<T> extends Object implements org.apache.kafka.streams.kstream.internals.WindowedSerializer<T>
  • Field Details

    • WINDOWED_INNER_SERIALIZER_CLASS

      public static final String WINDOWED_INNER_SERIALIZER_CLASS
      Default serializer for the inner serializer class of a windowed record. Must implement the Serde interface.
      See Also:
  • Constructor Details

    • SessionWindowedSerializer

      public SessionWindowedSerializer()
    • SessionWindowedSerializer

      public SessionWindowedSerializer(Serializer<T> inner)
  • Method Details

    • configure

      public void configure(Map<String,?> configs, boolean isKey)
      Description copied from interface: Serializer
      Configure this class.
      Specified by:
      configure in interface Serializer<T>
      Parameters:
      configs - configs in key/value pairs
      isKey - whether the serializer is used for the key or the value
    • serialize

      public byte[] serialize(String topic, Windowed<T> data)
      Description copied from interface: Serializer
      Convert data into a byte array.

      It is recommended to serialize null data to the null byte array.

      Specified by:
      serialize in interface Serializer<T>
      Parameters:
      topic - topic associated with data
      data - typed data; may be null
      Returns:
      serialized bytes; may be null
    • serialize

      public byte[] serialize(String topic, Headers headers, Windowed<T> data)
      Description copied from interface: Serializer
      Convert data into a byte array.

      It is recommended to serialize null data to the null byte array.

      Note that the passed in Headers may be empty, but never null. The implementation is allowed to modify the passed in headers, as a side effect of serialization. It is considered best practice to not delete or modify existing headers, but rather only add new ones.

      Specified by:
      serialize in interface Serializer<T>
      Parameters:
      topic - topic associated with data
      headers - headers associated with the record
      data - typed data; may be null
      Returns:
      serialized bytes; may be null
    • close

      public void close()
      Description copied from interface: Serializer
      Close this serializer.

      This method must be idempotent as it may be called multiple times.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Serializer<T>
    • serializeBaseKey

      public byte[] serializeBaseKey(String topic, Windowed<T> data)
      Specified by:
      serializeBaseKey in interface org.apache.kafka.streams.kstream.internals.WindowedSerializer<T>
    • serializeBaseKey

      public byte[] serializeBaseKey(String topic, Headers headers, Windowed<T> data)
      Specified by:
      serializeBaseKey in interface org.apache.kafka.streams.kstream.internals.WindowedSerializer<T>