Package io.deephaven.kafka.ingest
Class SchemaDiscovery
java.lang.Object
io.deephaven.kafka.ingest.SchemaDiscovery
- Direct Known Subclasses:
AvroDiscovery,ProtobufDiscovery
@ScriptApi public abstract class SchemaDiscovery extends Object
-
Constructor Summary
Constructors Constructor Description SchemaDiscovery() -
Method Summary
Modifier and Type Method Description static AvroDiscoveryavroFactory(File file)static AvroDiscoveryavroFactory(String schemaString)static AvroDiscoveryavroFactory(org.apache.avro.Schema schema)SchemaDiscoverycolumnPartition(String columnPartition)Set the column partition name.SchemagenerateDeephavenSchema()Generates a Deephaven schema using the parameters set in this builder.abstract org.jdom2.ElementgenerateDeephavenXml()Generates a Deephaven schema XML element using the parameters set in this builder.StringgetColumnPartition()StringgetKafkaKeyColumn()StringgetKafkaOffsetColumn()StringgetKafkaPartitionColumn()StringgetKafkaTimestampColumn()StringgetNamespace()StringgetTableName()io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehaviorgetUnmappableBehavior()SchemaDiscoverykafkaKeyColumn(String kafkaKeyColumn)SchemaDiscoverykafkaOffsetColumn(String kafkaOffsetColumn)Set the name of a column to use for the Kafka offset.SchemaDiscoverykafkaPartitionColumn(String kafkaPartitionColumn)Set the name of a column to use for the Kafka partition.SchemaDiscoverykafkaTimestampColumn(String kafkaTimestampColumn)Set the name of a column to use for the Kafka timestamp.SchemaDiscoverynamespace(String namespace)Set the resulting namespace.static ProtobufDiscoveryprotobufFactory(byte[] protobufDesc)static ProtobufDiscoveryprotobufFactory(File protobufFile)static ProtobufDiscoveryprotobufFactory(String protobufPath)SchemaDiscoverytableName(String tableName)Set the resulting table name.SchemaDiscoveryunmappableBehavior(io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehavior unmappableBehavior)Set what should happen when an unmappable type is encountered.
-
Constructor Details
-
SchemaDiscovery
public SchemaDiscovery()
-
-
Method Details
-
getNamespace
-
getTableName
-
getColumnPartition
-
getKafkaPartitionColumn
-
getKafkaOffsetColumn
-
getKafkaTimestampColumn
-
getKafkaKeyColumn
-
getUnmappableBehavior
public io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehavior getUnmappableBehavior() -
namespace
Set the resulting namespace.- Parameters:
namespace- the namespace of the result schema, if not set will be discovered from Avro schema- Returns:
- this builder
-
tableName
Set the resulting table name.- Parameters:
tableName- the name of the result schema, if not set will be discovered from Avro schema- Returns:
- this builder
-
columnPartition
Set the column partition name.- Parameters:
columnPartition- the name of the partitioning column- Returns:
- this builder
-
kafkaPartitionColumn
@ScriptApi @NotNull public SchemaDiscovery kafkaPartitionColumn(@NotNull String kafkaPartitionColumn)Set the name of a column to use for the Kafka partition.- Parameters:
kafkaPartitionColumn- the name of the Kafka partition column- Returns:
- this builder
-
kafkaOffsetColumn
Set the name of a column to use for the Kafka offset.- Parameters:
kafkaOffsetColumn- the name of the Kafka offset column- Returns:
- this builder
-
kafkaTimestampColumn
@ScriptApi @NotNull public SchemaDiscovery kafkaTimestampColumn(@NotNull String kafkaTimestampColumn)Set the name of a column to use for the Kafka timestamp.- Parameters:
kafkaTimestampColumn- the name of the Kafka timestamp column- Returns:
- this builder
-
kafkaKeyColumn
-
unmappableBehavior
@ScriptApi @NotNull public SchemaDiscovery unmappableBehavior(@NotNull io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehavior unmappableBehavior)Set what should happen when an unmappable type is encountered.- Parameters:
unmappableBehavior- the behavior on unmappable types- Returns:
- this builder
-
generateDeephavenSchema
Generates a Deephaven schema using the parameters set in this builder.- Returns:
- a Deephaven schema
-
generateDeephavenXml
Generates a Deephaven schema XML element using the parameters set in this builder.- Returns:
- a Deephaven schema XML element
-
avroFactory
@ScriptApi @NotNull public static AvroDiscovery avroFactory(@NotNull org.apache.avro.Schema schema) -
avroFactory
- Throws:
IOException
-
avroFactory
-
protobufFactory
@ScriptApi @NotNull public static ProtobufDiscovery protobufFactory(@NotNull String protobufPath) throws IOException- Throws:
IOException
-
protobufFactory
@ScriptApi @NotNull public static ProtobufDiscovery protobufFactory(@NotNull File protobufFile) throws IOException- Throws:
IOException
-
protobufFactory
@ScriptApi @NotNull public static ProtobufDiscovery protobufFactory(@NotNull byte[] protobufDesc) throws IOException- Throws:
IOException
-