Package io.deephaven.kafka.ingest
Class AvroDiscovery
java.lang.Object
io.deephaven.kafka.ingest.SchemaDiscovery
io.deephaven.kafka.ingest.AvroDiscovery
public class AvroDiscovery extends SchemaDiscovery
A builder for generating a Deephaven schema from an Avro schema.
-
Constructor Summary
Constructors Constructor Description AvroDiscovery() -
Method Summary
Modifier and Type Method Description AvroDiscoveryavroSchema(File file)Sets the Avro schema for this builder.AvroDiscoveryavroSchema(String schemaString)Sets the Avro schema for this builder.AvroDiscoveryavroSchema(org.apache.avro.Schema avroSchema)Sets the Avro schema for this builder.AvroDiscoverycolumnPartition(String columnPartition)Set the column partition name.org.jdom2.ElementgenerateDeephavenXml()Generates a Deephaven schema XML element using the parameters set in this builder.AvroDiscoverykafkaKeyColumn(String kafkaKeyColumn)AvroDiscoverykafkaOffsetColumn(String kafkaOffsetColumn)Set the name of a column to use for the Kafka offset.AvroDiscoverykafkaPartitionColumn(String kafkaPartitionColumn)Set the name of a column to use for the Kafka partition.AvroDiscoverykafkaTimestampColumn(String kafkaTimestampColumn)Set the name of a column to use for the Kafka timestamp.AvroDiscoverynamespace(String namespace)Set the resulting namespace.AvroDiscoverytableName(String tableName)Set the resulting table name.AvroDiscoveryunmappableBehavior(io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehavior unmappableBehavior)Set what should happen when an unmappable type is encountered.Methods inherited from class io.deephaven.kafka.ingest.SchemaDiscovery
avroFactory, avroFactory, avroFactory, generateDeephavenSchema, getColumnPartition, getKafkaKeyColumn, getKafkaOffsetColumn, getKafkaPartitionColumn, getKafkaTimestampColumn, getNamespace, getTableName, getUnmappableBehavior, protobufFactory, protobufFactory, protobufFactory
-
Constructor Details
-
AvroDiscovery
public AvroDiscovery()
-
-
Method Details
-
avroSchema
Sets the Avro schema for this builder.- Parameters:
avroSchema- the Avro schema object- Returns:
- this builder
-
avroSchema
Sets the Avro schema for this builder.- Parameters:
file- a file containing a JSON encoded Avro schema, seeSchema.Parser.parse(File).- Returns:
- this builder
- Throws:
IOException
-
avroSchema
Sets the Avro schema for this builder.- Parameters:
schemaString- a string containing a JSON encoded Avro schema, seeSchema.Parser.parse(String).- Returns:
- this builder
-
namespace
Description copied from class:SchemaDiscoverySet the resulting namespace.- Overrides:
namespacein classSchemaDiscovery- Parameters:
namespace- the namespace of the result schema, if not set will be discovered from Avro schema- Returns:
- this builder
-
tableName
Description copied from class:SchemaDiscoverySet the resulting table name.- Overrides:
tableNamein classSchemaDiscovery- Parameters:
tableName- the name of the result schema, if not set will be discovered from Avro schema- Returns:
- this builder
-
columnPartition
Description copied from class:SchemaDiscoverySet the column partition name.- Overrides:
columnPartitionin classSchemaDiscovery- Parameters:
columnPartition- the name of the partitioning column- Returns:
- this builder
-
kafkaPartitionColumn
Description copied from class:SchemaDiscoverySet the name of a column to use for the Kafka partition.- Overrides:
kafkaPartitionColumnin classSchemaDiscovery- Parameters:
kafkaPartitionColumn- the name of the Kafka partition column- Returns:
- this builder
-
kafkaOffsetColumn
Description copied from class:SchemaDiscoverySet the name of a column to use for the Kafka offset.- Overrides:
kafkaOffsetColumnin classSchemaDiscovery- Parameters:
kafkaOffsetColumn- the name of the Kafka offset column- Returns:
- this builder
-
kafkaTimestampColumn
Description copied from class:SchemaDiscoverySet the name of a column to use for the Kafka timestamp.- Overrides:
kafkaTimestampColumnin classSchemaDiscovery- Parameters:
kafkaTimestampColumn- the name of the Kafka timestamp column- Returns:
- this builder
-
kafkaKeyColumn
- Overrides:
kafkaKeyColumnin classSchemaDiscovery
-
unmappableBehavior
@NotNull public AvroDiscovery unmappableBehavior(@NotNull io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehavior unmappableBehavior)Description copied from class:SchemaDiscoverySet what should happen when an unmappable type is encountered.- Overrides:
unmappableBehaviorin classSchemaDiscovery- Parameters:
unmappableBehavior- the behavior on unmappable types- Returns:
- this builder
-
generateDeephavenXml
@NotNull public org.jdom2.Element generateDeephavenXml()Generates a Deephaven schema XML element using the parameters set in this builder.- Specified by:
generateDeephavenXmlin classSchemaDiscovery- Returns:
- a Deephaven schema XML element
-