Class SchemaDiscovery

java.lang.Object
io.deephaven.kafka.ingest.SchemaDiscovery
Direct Known Subclasses:
AvroDiscovery, ProtobufDiscovery

@ScriptApi public abstract class SchemaDiscovery extends Object
  • Constructor Details

    • SchemaDiscovery

      public SchemaDiscovery()
  • Method Details

    • getNamespace

      public String getNamespace()
    • getTableName

      public String getTableName()
    • getColumnPartition

      public String getColumnPartition()
    • getKafkaPartitionColumn

      public String getKafkaPartitionColumn()
    • getKafkaOffsetColumn

      public String getKafkaOffsetColumn()
    • getKafkaTimestampColumn

      public String getKafkaTimestampColumn()
    • getKafkaKeyColumn

      public String getKafkaKeyColumn()
    • getUnmappableBehavior

      public io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehavior getUnmappableBehavior()
    • namespace

      @ScriptApi @NotNull public SchemaDiscovery namespace(@NotNull String 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

      @ScriptApi @NotNull public SchemaDiscovery tableName(@NotNull String 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

      @ScriptApi @NotNull public SchemaDiscovery columnPartition(@NotNull String 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

      @ScriptApi @NotNull public SchemaDiscovery kafkaOffsetColumn(@NotNull String 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

      @ScriptApi @NotNull public SchemaDiscovery kafkaKeyColumn(@NotNull String 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

      @ScriptApi @NotNull public Schema generateDeephavenSchema()
      Generates a Deephaven schema using the parameters set in this builder.
      Returns:
      a Deephaven schema
    • generateDeephavenXml

      @ScriptApi @NotNull public abstract org.jdom2.Element 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

      @ScriptApi @NotNull public static AvroDiscovery avroFactory(@NotNull File file) throws IOException
      Throws:
      IOException
    • avroFactory

      @ScriptApi @NotNull public static AvroDiscovery avroFactory(@NotNull String schemaString)
    • 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