Class BigQuerySinkConfig<T>

java.lang.Object
io.github.flink.gcp.connector.bigquery.sink.BigQuerySinkConfig<T>
Type Parameters:
T - type of the records written by the sink
All Implemented Interfaces:
Serializable

@Internal public final class BigQuerySinkConfig<T> extends Object implements Serializable
Immutable configuration shared by all WriteMethod implementations, assembled by BigQuerySinkBuilder.
See Also:
  • Method Details

    • getDestinationResolver

      public DestinationResolver<? super T> getDestinationResolver()
      Returns the per-record destination resolver.
    • getSerializer

      public BigQueryProtoSerializationSchema<? super T> getSerializer()
      Returns the record serializer.
    • getCdcOptions

      @Nullable public CdcOptions<? super T> getCdcOptions()
      Returns the configured CDC options, or null when ordinary appends are used.
    • getTableSchema

      public com.google.cloud.bigquery.storage.v1.TableSchema getTableSchema(TableDestination destination)
      Returns the physical table schema, including configured additional fields.
    • managesCdcTableContract

      public boolean managesCdcTableContract()
      Returns whether the connector verifies and provisions CDC tables: true exactly when CDC options are configured.
    • getWriteDescriptor

      public com.google.protobuf.Descriptors.Descriptor getWriteDescriptor(TableDestination destination)
      Returns the descriptor sent to a writer, including every additional or write-only field.
    • getSchemaFingerprint

      public Object getSchemaFingerprint(TableDestination destination)
      Returns the delegate fingerprint; configured additional-field declarations are immutable.
    • prepareWriteSchema

      public void prepareWriteSchema(TableDestination destination)
      Validates the effective schema surfaces before entering per-row failure handling.
    • serialize

      @Nullable public com.google.protobuf.ByteString serialize(T element, TableDestination destination) throws IOException
      Serializes a row for its destination, including configured additional or write-only fields.
      Throws:
      SchemaDerivationException - when the destination's schema failed to derive while the row was serialized, typically because the serializer changed it. It wraps the failure prepareWriteSchema(TableDestination) would report, so a caller fails on it rather than handling it as the row's.
      IOException
    • serializeRow

      @Nullable public SerializedRow serializeRow(T element, TableDestination destination) throws IOException
      Serializes a row for its destination without encoding it, for a write method that walks the row rather than sending its bytes.

      The row's base is the serializer's own: the message it built when it is a ProtoRowMessageProvider, and its bytes otherwise. Configured additional or write-only fields are the row's tail. SerializedRow.toByteString() returns what serialize(Object, TableDestination) would.

      Throws:
      SchemaDerivationException - as serialize(Object, TableDestination) does
      IOException
    • addsRowFields

      public boolean addsRowFields()
      Returns whether rows carry fields added after the serializer, which a SerializedRow holds as its tail.
    • getSerializerDescriptor

      public com.google.protobuf.Descriptors.Descriptor getSerializerDescriptor(TableDestination destination)
      Returns the configured serializer's own descriptor for the destination, which describes a SerializedRow's base; getWriteDescriptor(TableDestination) adds the tail's fields to it.
    • getCreateDisposition

      public CreateDisposition getCreateDisposition()
      Returns the table create disposition.
    • getTableCreateOptionsProvider

      public TableCreateOptionsProvider getTableCreateOptionsProvider()
      Returns the per-destination creation options provider for auto-created tables.
    • getCdcTableOptionsProvider

      public CdcTableOptionsProvider getCdcTableOptionsProvider()
      Returns the per-destination desired CDC table contract.
    • getCdcTableReconciliationPolicy

      public CdcTableReconciliationPolicy getCdcTableReconciliationPolicy()
      Returns how this job handles CDC tables that already exist.
    • getSchemaUpdateOptions

      public SchemaUpdateOptions getSchemaUpdateOptions()
      Returns the options gating connector-driven table schema updates.
    • getFailureHandler

      public FailureHandler<? super BigQueryFailure> getFailureHandler()
      Returns the handler for record-specific routing and row failures.
    • getLocation

      public String getLocation()
      Returns the BigQuery location (for example US or asia-northeast1) of the destination tables, or null when unset.
    • getServiceAccountKeyFile

      @Nullable public String getServiceAccountKeyFile()
      Returns the service-account JSON key-file path, or null when clients use ADC.

      Only the path is serialized into the job graph; runtime components load the file when they create their clients.

    • getEmulatorEndpoint

      @Nullable public EmulatorEndpoint getEmulatorEndpoint()
      Returns the emulator endpoint the Storage Write API connections use, or null when the sink talks to the production service.
    • getEmulatorRestEndpoint

      @Nullable public EmulatorEndpoint getEmulatorRestEndpoint()
      Returns the emulator endpoint the table metadata (REST) client uses, or null when it talks to the production service. Separate from getEmulatorEndpoint() because BigQuery serves gRPC and REST on different ports.