java.lang.Object
java.lang.Enum<WriteMethod>
io.github.flink.gcp.connector.bigquery.sink.WriteMethod
All Implemented Interfaces:
Serializable, Comparable<WriteMethod>, java.lang.constant.Constable

@Public public enum WriteMethod extends Enum<WriteMethod>
The mechanism used to write records to BigQuery.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Stages records as files on Cloud Storage and imports them with BigQuery load jobs.
    Appends to the destination table's Storage Write API default stream.
    Writes through application-created Storage Write API buffered streams committed with a two-phase commit protocol on Flink checkpoints: rows are appended at explicit offsets and become visible only when a completed checkpoint's commit flushes them.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the hyphenated lower-case spelling this constant takes in a sink.write-method DDL option, for example storage-api-at-least-once.
    Returns the enum constant of this type with the specified name.
    static WriteMethod[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • STORAGE_API_AT_LEAST_ONCE

      public static final WriteMethod STORAGE_API_AT_LEAST_ONCE
      Appends to the destination table's Storage Write API default stream.

      At-least-once semantics. Supports dynamic per-record table destinations; connection multiplexing across destination tables is delegated to the BigQuery Storage client's connection pool.

    • STORAGE_API_EXACTLY_ONCE

      public static final WriteMethod STORAGE_API_EXACTLY_ONCE
      Writes through application-created Storage Write API buffered streams committed with a two-phase commit protocol on Flink checkpoints: rows are appended at explicit offsets and become visible only when a completed checkpoint's commit flushes them.

      Exactly-once semantics. Supports fixed and dynamic destinations and requires bufferedStreamOptions(...). Each subtask reuses one buffered stream per active destination across checkpoints (tracked in writer state). Streaming execution requires exactly-once checkpointing with checkpoints-after-tasks-finish; batch execution commits at end of input. Mid-stream schema changes reconnect the same remote stream with the current serializer descriptor, preserving its name and append offset.

    • FILE_LOADS

      public static final WriteMethod FILE_LOADS
      Stages records as files on Cloud Storage and imports them with BigQuery load jobs.

      Always exactly-once. Batch execution loads everything at end of input; streaming execution loads each checkpoint's files (checkpointing required, WriteDisposition.WRITE_APPEND only, and mind BigQuery's daily load-job and destination-table modification limits — checkpoint intervals of 2-5 minutes or more).

  • Method Details

    • values

      public static WriteMethod[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static WriteMethod valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Returns the hyphenated lower-case spelling this constant takes in a sink.write-method DDL option, for example storage-api-at-least-once.

      Flink resolves an enum-valued ConfigOption by matching this string case-insensitively and normalizing nothing else, so the DDL vocabulary is defined here rather than by a table-local copy of the enum. Use Enum.name() where a message means the Java constant.

      Overrides:
      toString in class Enum<WriteMethod>