Package io.deephaven.kafka.ingest
Class SchemaDiscovery
java.lang.Object
io.deephaven.kafka.ingest.SchemaDiscovery
- Direct Known Subclasses:
AvroDiscovery
,ProtobufDiscovery
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AvroDiscovery
avroFactory
(File file) static AvroDiscovery
avroFactory
(String schemaString) static AvroDiscovery
avroFactory
(org.apache.avro.Schema schema) columnPartition
(String columnPartition) Set the column partition name.Generates a Deephaven schema using the parameters set in this builder.abstract org.jdom2.Element
Generates a Deephaven schema XML element using the parameters set in this builder.io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehavior
kafkaKeyColumn
(String kafkaKeyColumn) kafkaOffsetColumn
(String kafkaOffsetColumn) Set the name of a column to use for the Kafka offset.kafkaPartitionColumn
(String kafkaPartitionColumn) Set the name of a column to use for the Kafka partition.kafkaTimestampColumn
(String kafkaTimestampColumn) Set the name of a column to use for the Kafka timestamp.Set the resulting namespace.static ProtobufDiscovery
protobufFactory
(byte[] protobufDesc) static ProtobufDiscovery
protobufFactory
(File protobufFile) static ProtobufDiscovery
protobufFactory
(String protobufPath) Set the resulting table name.unmappableBehavior
(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
-
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
-