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 Details

    • AvroDiscovery

      public AvroDiscovery()
  • Method Details

    • avroSchema

      @NotNull public AvroDiscovery avroSchema(@NotNull org.apache.avro.Schema avroSchema)
      Sets the Avro schema for this builder.
      Parameters:
      avroSchema - the Avro schema object
      Returns:
      this builder
    • avroSchema

      @NotNull public AvroDiscovery avroSchema(@NotNull File file) throws IOException
      Sets the Avro schema for this builder.
      Parameters:
      file - a file containing a JSON encoded Avro schema, see Schema.Parser.parse(File).
      Returns:
      this builder
      Throws:
      IOException
    • avroSchema

      @NotNull public AvroDiscovery avroSchema(@NotNull String schemaString)
      Sets the Avro schema for this builder.
      Parameters:
      schemaString - a string containing a JSON encoded Avro schema, see Schema.Parser.parse(String).
      Returns:
      this builder
    • namespace

      @NotNull public AvroDiscovery namespace(@NotNull String namespace)
      Description copied from class: SchemaDiscovery
      Set the resulting namespace.
      Overrides:
      namespace in class SchemaDiscovery
      Parameters:
      namespace - the namespace of the result schema, if not set will be discovered from Avro schema
      Returns:
      this builder
    • tableName

      @NotNull public AvroDiscovery tableName(@NotNull String tableName)
      Description copied from class: SchemaDiscovery
      Set the resulting table name.
      Overrides:
      tableName in class SchemaDiscovery
      Parameters:
      tableName - the name of the result schema, if not set will be discovered from Avro schema
      Returns:
      this builder
    • columnPartition

      @NotNull public AvroDiscovery columnPartition(@NotNull String columnPartition)
      Description copied from class: SchemaDiscovery
      Set the column partition name.
      Overrides:
      columnPartition in class SchemaDiscovery
      Parameters:
      columnPartition - the name of the partitioning column
      Returns:
      this builder
    • kafkaPartitionColumn

      @NotNull public AvroDiscovery kafkaPartitionColumn(@NotNull String kafkaPartitionColumn)
      Description copied from class: SchemaDiscovery
      Set the name of a column to use for the Kafka partition.
      Overrides:
      kafkaPartitionColumn in class SchemaDiscovery
      Parameters:
      kafkaPartitionColumn - the name of the Kafka partition column
      Returns:
      this builder
    • kafkaOffsetColumn

      @NotNull public AvroDiscovery kafkaOffsetColumn(@NotNull String kafkaOffsetColumn)
      Description copied from class: SchemaDiscovery
      Set the name of a column to use for the Kafka offset.
      Overrides:
      kafkaOffsetColumn in class SchemaDiscovery
      Parameters:
      kafkaOffsetColumn - the name of the Kafka offset column
      Returns:
      this builder
    • kafkaTimestampColumn

      @NotNull public AvroDiscovery kafkaTimestampColumn(@NotNull String kafkaTimestampColumn)
      Description copied from class: SchemaDiscovery
      Set the name of a column to use for the Kafka timestamp.
      Overrides:
      kafkaTimestampColumn in class SchemaDiscovery
      Parameters:
      kafkaTimestampColumn - the name of the Kafka timestamp column
      Returns:
      this builder
    • kafkaKeyColumn

      @NotNull public AvroDiscovery kafkaKeyColumn(@NotNull String kafkaKeyColumn)
      Overrides:
      kafkaKeyColumn in class SchemaDiscovery
    • unmappableBehavior

      @NotNull public AvroDiscovery unmappableBehavior(@NotNull io.deephaven.kafka.ingest.SchemaDiscovery.UnmappableBehavior unmappableBehavior)
      Description copied from class: SchemaDiscovery
      Set what should happen when an unmappable type is encountered.
      Overrides:
      unmappableBehavior in class SchemaDiscovery
      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:
      generateDeephavenXml in class SchemaDiscovery
      Returns:
      a Deephaven schema XML element