Class TableCreateOptions

java.lang.Object
io.github.flink.gcp.connector.bigtable.sink.TableCreateOptions
All Implemented Interfaces:
Serializable

@Public public final class TableCreateOptions extends Object implements Serializable
The settings for the table the sink creates under CreateDisposition.CREATE_IF_NEEDED: its column families, their value types and optional garbage-collection rules.

Unlike the Pub/Sub sink's topic settings, this object is required beside CREATE_IF_NEEDED rather than additive: a topic can meaningfully be created with defaults, but a Bigtable table's schema is its column families, which the sink cannot guess — a table created without them rejects every mutation and is a table someone has to fix later. Combining options with CreateDisposition.CREATE_NEVER is rejected at build(), and so is CREATE_IF_NEEDED without options.

Add-only, per family. Missing declared families are added with their types and rules. Options containing aggregate types require every existing declared type to match and inspect them before a destination first receives data, requiring bigtable.tables.get. Raw-only options retain name-only reconciliation of existing families. An existing family's garbage-collection rule is neither compared nor updated. A family declared without a rule keeps Bigtable's default of collecting nothing; see GcRule for why that choice matters for an at-least-once sink.

Validation stops at what would otherwise fail obscurely (a blank name, an empty family set); Bigtable's own name grammar and limits are left to the service, whose rejection names the field and the limit. Instances are immutable and serializable.

See Also:
  • Method Details

    • builder

      public static TableCreateOptions.Builder builder()
      Returns:
      a new builder
    • getColumnFamilies

      public Map<String,GcRule> getColumnFamilies()
      Returns the column families to create, in declaration order, each mapped to its garbage-collection rule or to null for none.
    • getColumnFamilyTypes

      public Map<String,ColumnFamilyType> getColumnFamilyTypes()
      Returns the value type of every declared family, in declaration order. Families restored from job graphs predating typed creation are raw.
      Returns:
      an immutable family-to-type map
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object