Package io.deephaven.kafka.ingest
Class PojoConsumerRecordToTableWriterAdapter.Builder
java.lang.Object
io.deephaven.kafka.ingest.PojoConsumerRecordToTableWriterAdapter.Builder
- Enclosing class:
- PojoConsumerRecordToTableWriterAdapter<K,V>
public static class PojoConsumerRecordToTableWriterAdapter.Builder extends Object
A builder for the PojoConsumerRecordToTableWriterAdapter.
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description PojoConsumerRecordToTableWriterAdapter.Builder
addColumnToKeyField(String column, String field)
Maps a column to a field in the key classPojoConsumerRecordToTableWriterAdapter.Builder
addColumnToKeyMethod(String column, String method)
Maps a column to a method in the key classPojoConsumerRecordToTableWriterAdapter.Builder
addColumnToSetter(String column, String setter)
Maps a column to setter text in the compiled adapter class.PojoConsumerRecordToTableWriterAdapter.Builder
addColumnToValueField(String column, String field)
Maps a column to a method in the value classPojoConsumerRecordToTableWriterAdapter.Builder
addColumnToValueMethod(String column, String method)
Maps a column to a method in the value classPojoConsumerRecordToTableWriterAdapter.Builder
allowUnmapped(boolean allowUnmapped)
If set to true, unmapped columns are not an error.PojoConsumerRecordToTableWriterAdapter.Builder
allowUnmapped(String allowUnmapped)
Specifies that the given column should not be mapped.PojoConsumerRecordToTableWriterAdapter.Builder
caseInsensitiveSearch(boolean caseInsensitiveSearch)
If set to true, a case insensitive search for column mappings is performed.PojoConsumerRecordToTableWriterAdapter.Builder
kafkaPartitionColumnName(String kafkaPartitionColumnName)
Set the name of the column which stores the Kafka partition identifier of the record.PojoConsumerRecordToTableWriterAdapter.Builder
keyClass(Class<?> keyClass)
Set the class to use for deserialized keys.PojoConsumerRecordToTableWriterAdapter.Builder
offsetColumnName(String offsetColumnName)
Set the name of the column which stores the Kafka offset of the record.PojoConsumerRecordToTableWriterAdapter.Builder
setPrintClassBody(boolean printClassBody)
PojoConsumerRecordToTableWriterAdapter.Builder
timestampColumnName(String timestampColumnName)
Set the name of the column which stores the Kafka timestamp of the record.PojoConsumerRecordToTableWriterAdapter.Builder
valueClass(Class<?> valueClass)
Set the class to use for deserialized values.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
offsetColumnName
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder offsetColumnName(@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
-
timestampColumnName
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder timestampColumnName(@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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder kafkaPartitionColumnName(@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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder keyClass(@NotNull Class<?> keyClass)Set the class to use for deserialized keys.- Parameters:
keyClass
- the class for deserialized keys- Returns:
- this builder
-
valueClass
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder valueClass(@NotNull Class<?> valueClass)Set the class to use for deserialized values.- Parameters:
valueClass
- the class for deserialized values- Returns:
- this builder
-
allowUnmapped
@NotNull public 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
@NotNull public 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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder allowUnmapped(@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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder addColumnToKeyField(@NotNull String column, @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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder addColumnToKeyMethod(@NotNull String column, @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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder addColumnToValueField(@NotNull String column, @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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder addColumnToValueMethod(@NotNull String column, @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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder addColumnToSetter(@NotNull String column, @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
@NotNull public PojoConsumerRecordToTableWriterAdapter.Builder setPrintClassBody(boolean printClassBody)
-