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
-
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:KeyOrValueSerializer
Create a chunk of output keys or values that correspond torowSequence
. The outputchunks
should be cached in thecontext
for re-use, but the data returned in them should be functionally immutable and not rely on pooled or re-usable objects.- Specified by:
handleChunk
in interfaceKeyOrValueSerializer<SERIALIZED_TYPE>
- Parameters:
context
- AKeyOrValueSerializer.Context
created 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:KeyOrValueSerializer
Create a context for callingKeyOrValueSerializer.handleChunk(Context, RowSequence, boolean)
.- Specified by:
makeContext
in interfaceKeyOrValueSerializer<SERIALIZED_TYPE>
- Parameters:
size
- The maximum number of rows that will be serialized for each chunk- Returns:
- A Context for the KeyOrValueSerializer
-