Package io.deephaven.kafka.publish
Class GenericRecordKeyOrValueSerializer
java.lang.Object
io.deephaven.kafka.publish.GenericRecordKeyOrValueSerializer
- All Implemented Interfaces:
KeyOrValueSerializer<org.apache.avro.generic.GenericRecord>
public class GenericRecordKeyOrValueSerializer
extends Object
implements KeyOrValueSerializer<org.apache.avro.generic.GenericRecord>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.kafka.publish.KeyOrValueSerializer
KeyOrValueSerializer.Context
-
Field Summary
Modifier and TypeFieldDescriptionprotected final List<io.deephaven.kafka.publish.GenericRecordKeyOrValueSerializer.GenericRecordFieldProcessor>
-
Constructor Summary
ConstructorDescriptionGenericRecordKeyOrValueSerializer
(Table source, org.apache.avro.Schema schema, String[] columnNames, String timestampFieldName, Properties columnProperties) -
Method Summary
Modifier and TypeMethodDescriptionObjectChunk<org.apache.avro.generic.GenericRecord,
Values> handleChunk
(KeyOrValueSerializer.Context context, RowSequence toProcess, boolean previous) Process the given update RowSequence and returns a list of JSON strings, reach representing one row of data.makeContext
(int size) Create a context for callingKeyOrValueSerializer.handleChunk(Context, RowSequence, boolean)
.
-
Field Details
-
fieldProcessors
protected final List<io.deephaven.kafka.publish.GenericRecordKeyOrValueSerializer.GenericRecordFieldProcessor> fieldProcessors
-
-
Constructor Details
-
GenericRecordKeyOrValueSerializer
public GenericRecordKeyOrValueSerializer(Table source, org.apache.avro.Schema schema, String[] columnNames, String timestampFieldName, Properties columnProperties)
-
-
Method Details
-
handleChunk
public ObjectChunk<org.apache.avro.generic.GenericRecord,Values> handleChunk(KeyOrValueSerializer.Context context, RowSequence toProcess, boolean previous) Process the given update RowSequence and returns a list of JSON strings, reach representing one row of data.- Specified by:
handleChunk
in interfaceKeyOrValueSerializer<org.apache.avro.generic.GenericRecord>
- Parameters:
toProcess
- A RowSequence indicating which rows were involvedprevious
- True if this should be performed using the 'previous' data instead of current, as for removals.context
- AKeyOrValueSerializer.Context
created byKeyOrValueSerializer.makeContext(int)
- Returns:
- A List of Strings containing all of the parsed update statements
-
makeContext
Description copied from interface:KeyOrValueSerializer
Create a context for callingKeyOrValueSerializer.handleChunk(Context, RowSequence, boolean)
.- Specified by:
makeContext
in interfaceKeyOrValueSerializer<org.apache.avro.generic.GenericRecord>
- Parameters:
size
- The maximum number of rows that will be serialized for each chunk- Returns:
- A Context for the KeyOrValueSerializer
-