Package io.deephaven.kafka.publish
Class SimpleKeyOrValueSerializer<SERIALIZED_TYPE>
java.lang.Object
io.deephaven.kafka.publish.SimpleKeyOrValueSerializer<SERIALIZED_TYPE>
- All Implemented Interfaces:
KeyOrValueSerializer<SERIALIZED_TYPE>
public class SimpleKeyOrValueSerializer<SERIALIZED_TYPE>
extends Object
implements KeyOrValueSerializer<SERIALIZED_TYPE>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.kafka.publish.KeyOrValueSerializer
KeyOrValueSerializer.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleChunk(@NotNull KeyOrValueSerializer.Context context, @NotNull RowSequence rowSequence, boolean previous) Create a chunk of output keys or values that correspond torowSequence.makeContext(int size) Create a context for callingKeyOrValueSerializer.handleChunk(Context, RowSequence, boolean).
-
Constructor Details
-
SimpleKeyOrValueSerializer
-
-
Method Details
-
handleChunk
public ObjectChunk<SERIALIZED_TYPE,Values> handleChunk(@NotNull @NotNull KeyOrValueSerializer.Context context, @NotNull @NotNull RowSequence rowSequence, boolean previous) Description copied from interface:KeyOrValueSerializerCreate a chunk of output keys or values that correspond torowSequence. The outputchunksshould be cached in thecontextfor re-use, but the data returned in them should be functionally immutable and not rely on pooled or re-usable objects.- Specified by:
handleChunkin interfaceKeyOrValueSerializer<SERIALIZED_TYPE>- Parameters:
context- AKeyOrValueSerializer.Contextcreated byKeyOrValueSerializer.makeContext(int)rowSequence- The row keys to serializeprevious- If previous row values should be used, as with row key removals- Returns:
- A chunk of serialized data keys or values, with
ObjectChunk.size() == rowSequence.size()
-
makeContext
Description copied from interface:KeyOrValueSerializerCreate a context for callingKeyOrValueSerializer.handleChunk(Context, RowSequence, boolean).- Specified by:
makeContextin interfaceKeyOrValueSerializer<SERIALIZED_TYPE>- Parameters:
size- The maximum number of rows that will be serialized for each chunk- Returns:
- A Context for the KeyOrValueSerializer
-