T
- Type of the KafkaAvroTableSource produced by the builder.B
- Type of the KafkaAvroTableSource.Builder subclass.protected abstract static class KafkaAvroTableSource.Builder<T extends KafkaAvroTableSource,B extends KafkaAvroTableSource.Builder> extends KafkaTableSource.Builder<T,B>
KafkaAvroTableSource
to be extended by builders of subclasses of
KafkaAvroTableSource.Modifier | Constructor and Description |
---|---|
protected |
Builder() |
Modifier and Type | Method and Description |
---|---|
protected void |
configureTableSource(T source)
Configures a TableSource with optional parameters.
|
B |
forAvroRecordClass(Class<? extends org.apache.avro.specific.SpecificRecordBase> avroClass)
Sets the class of the Avro records that aree read from the Kafka topic.
|
protected Class<? extends org.apache.avro.specific.SpecificRecordBase> |
getAvroRecordClass()
Returns the configured Avro class.
|
B |
withTableToAvroMapping(Map<String,String> schemaToAvroMapping)
Sets a mapping from schema fields to fields of the produced Avro record.
|
build, builder, forTopic, fromEarliest, fromGroupOffsets, fromLatest, fromSpecificOffsets, getKafkaProps, getTableSchema, getTopic, supportsKafkaTimestamps, withKafkaProperties, withKafkaTimestampAsRowtimeAttribute, withProctimeAttribute, withRowtimeAttribute, withSchema
public B forAvroRecordClass(Class<? extends org.apache.avro.specific.SpecificRecordBase> avroClass)
avroClass
- The class of the Avro records that are read from the Kafka topic.public B withTableToAvroMapping(Map<String,String> schemaToAvroMapping)
A field mapping is required if the fields of produced tables should be named different than the fields of the Avro record. The key of the provided Map refers to the field of the table schema, the value to the field of the Avro record.
schemaToAvroMapping
- A mapping from schema fields to Avro fields.protected Class<? extends org.apache.avro.specific.SpecificRecordBase> getAvroRecordClass()
protected void configureTableSource(T source)
KafkaTableSource.Builder
configureTableSource
in class KafkaTableSource.Builder<T extends KafkaAvroTableSource,B extends KafkaAvroTableSource.Builder>
source
- The TableSource to configure.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.