Package io.deephaven.kafka.ingest
Class PojoConsumerRecordToTableWriterAdapter.Builder
java.lang.Object
io.deephaven.kafka.ingest.PojoConsumerRecordToTableWriterAdapter.Builder
- Enclosing class:
- PojoConsumerRecordToTableWriterAdapter<K,
V>
A builder for the PojoConsumerRecordToTableWriterAdapter.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddColumnToKeyField(@NotNull String column, @NotNull String field) Maps a column to a field in the key classaddColumnToKeyMethod(@NotNull String column, @NotNull String method) Maps a column to a method in the key classaddColumnToSetter(@NotNull String column, @NotNull String setter) Maps a column to setter text in the compiled adapter class.addColumnToValueField(@NotNull String column, @NotNull String field) Maps a column to a method in the value classaddColumnToValueMethod(@NotNull String column, @NotNull String method) Maps a column to a method in the value classallowUnmapped(boolean allowUnmapped) If set to true, unmapped columns are not an error.allowUnmapped(@NotNull String allowUnmapped) Specifies that the given column should not be mapped.caseInsensitiveSearch(boolean caseInsensitiveSearch) If set to true, a case insensitive search for column mappings is performed.kafkaPartitionColumnName(@NotNull String kafkaPartitionColumnName) Set the name of the column which stores the Kafka partition identifier of the record.Set the class to use for deserialized keys.offsetColumnName(@NotNull String offsetColumnName) Set the name of the column which stores the Kafka offset of the record.recvTimeColumnName(@NotNull String recvTimeColumnName) Set the name of the column which stores the time that the record was received by the ingester.If a filter is added, then all records will be passed through the predicate before being consumed.setPrintClassBody(boolean printClassBody) timestampColumnName(@NotNull String timestampColumnName) Set the name of the column which stores the Kafka timestamp of the record.valueClass(@NotNull Class<?> valueClass) Set the class to use for deserialized values.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
offsetColumnName
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder offsetColumnName(@NotNull @NotNull String offsetColumnName) Set the name of the column which stores the Kafka offset of the record.- Parameters:
offsetColumnName- the name of the column in the output table- Returns:
- this builder
-
recvTimeColumnName
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder recvTimeColumnName(@NotNull @NotNull String recvTimeColumnName) Set the name of the column which stores the time that the record was received by the ingester.- Parameters:
recvTimeColumnName- the name of the column in the output table- Returns:
- this builder
-
timestampColumnName
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder timestampColumnName(@NotNull @NotNull String timestampColumnName) Set the name of the column which stores the Kafka timestamp of the record.- Parameters:
timestampColumnName- the name of the column in the output table- Returns:
- this builder
-
kafkaPartitionColumnName
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder kafkaPartitionColumnName(@NotNull @NotNull String kafkaPartitionColumnName) Set the name of the column which stores the Kafka partition identifier of the record.- Parameters:
kafkaPartitionColumnName- the name of the column in the output table- Returns:
- this builder
-
keyClass
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder keyClass(@NotNull @NotNull Class<?> keyClass) Set the class to use for deserialized keys.- Parameters:
keyClass- the class for deserialized keys- Returns:
- this builder
-
valueClass
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder valueClass(@NotNull @NotNull Class<?> valueClass) Set the class to use for deserialized values.- Parameters:
valueClass- the class for deserialized values- Returns:
- this builder
-
allowUnmapped
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder allowUnmapped(boolean allowUnmapped) If set to true, unmapped columns are not an error.- Parameters:
allowUnmapped- should unmapped columns be ignored?- Returns:
- this builder
-
caseInsensitiveSearch
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder caseInsensitiveSearch(boolean caseInsensitiveSearch) If set to true, a case insensitive search for column mappings is performed.- Parameters:
caseInsensitiveSearch- should a case-insensitive search for matching columns be performed?- Returns:
- this builder
-
allowUnmapped
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder allowUnmapped(@NotNull @NotNull String allowUnmapped) Specifies that the given column should not be mapped.- Parameters:
allowUnmapped- the column name that should remain unmapped- Returns:
- this builder
-
addColumnToKeyField
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder addColumnToKeyField(@NotNull @NotNull String column, @NotNull @NotNull String field) Maps a column to a field in the key class- Parameters:
column- the column name in the output tablefield- a field name in the key class- Returns:
- this builder
-
addColumnToKeyMethod
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder addColumnToKeyMethod(@NotNull @NotNull String column, @NotNull @NotNull String method) Maps a column to a method in the key class- Parameters:
column- the column name in the output tablemethod- a method name in the key class- Returns:
- this builder
-
addColumnToValueField
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder addColumnToValueField(@NotNull @NotNull String column, @NotNull @NotNull String field) Maps a column to a method in the value class- Parameters:
column- the column name in the output tablefield- a method name in the value class- Returns:
- this builder
-
addColumnToValueMethod
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder addColumnToValueMethod(@NotNull @NotNull String column, @NotNull @NotNull String method) Maps a column to a method in the value class- Parameters:
column- the column name in the output tablemethod- a method name in the value class- Returns:
- this builder
-
addColumnToSetter
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder addColumnToSetter(@NotNull @NotNull String column, @NotNull @NotNull String setter) Maps a column to setter text in the compiled adapter class. The Kafka record will have the name "record", and can be referenced for example by:.addColumnToSetter("UserId", "((ksql.pageviews)record.value()).getUserid().toString()")- Parameters:
column- the column namesetter- the setter text- Returns:
- this builder
-
setPrintClassBody
@ScriptApi @NotNull public @NotNull PojoConsumerRecordToTableWriterAdapter.Builder setPrintClassBody(boolean printClassBody) -
setFilter
@ScriptApi @NotNull public PojoConsumerRecordToTableWriterAdapter.Builder setFilter(Predicate<org.apache.kafka.clients.consumer.ConsumerRecord<?, ?>> recordPredicate) If a filter is added, then all records will be passed through the predicate before being consumed. Only records that match the predicate will be ingested.- Parameters:
recordPredicate- returns true if the record should be ingested, otherwise false- Returns:
- this builder
-