Class BigtableDataClients

java.lang.Object
io.github.flink.gcp.connector.bigtable.BigtableDataClients

@Internal public final class BigtableDataClients extends Object
How this connector points a BigtableDataClient at an instance: production over application-default credentials, production over a runtime-loaded service-account provider, or an emulator over a plaintext channel with no credentials.

At the module root rather than beside either direction, because every data-client boundary of this connector takes it — the sink, both sources and the table layer all build the same settings from the same inputs. The admin clients do not come through here: BigtableTableAdmin and the Change Streams coordinator build their own settings, and each carries its own copy of the emulator branch. A second copy of this branch is exactly the thing that reads green on a machine with credentials and red in CI — the failure ADR-0064 exists to describe.

Only what every path shares lives here. Per-caller tuning — the sink's batch thresholds, and whatever a source may one day need — is applied by the caller on top of the builder this hands back, which is why the return type is the builder rather than the settings.

Retry settings are deliberately untouched, on every path. The client retries MutateRows per entry, resumes a broken ReadRows stream from the last key it saw, and resumes a broken ReadChangeStream from its last continuation token. Only a failure that outlives the client's own retry budget reaches the connector, and on the Change Streams path the reader turns that into a terminal failure so Flink restarts from the checkpointed token. So nothing here owns a retry loop, and nothing has a retry knob to map. The single-row request family is the one caller that touches a call's settings on top of this builder — DefaultSingleRowClientFactory pins CheckAndMutateRow and ReadModifyWriteRow to a single attempt under its configured deadline — and it leaves the retryable-code sets as the client ships them, which for those two RPCs is empty (ADR-0148).

  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Returns the key under which every client pool shares one client per instance: the project and instance a destination names, in the one spelling the pools and the per-instance bookkeeping all use.
    static com.google.cloud.bigtable.data.v2.BigtableDataSettings.Builder
    settings(TableDestination destination, String appProfileId, EmulatorEndpoint emulatorEndpoint, com.google.api.gax.core.CredentialsProvider credentialsOverride)
    Builds the settings for a client that talks to a destination's instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • instanceKey

      public static String instanceKey(TableDestination destination)
      Returns the key under which every client pool shares one client per instance: the project and instance a destination names, in the one spelling the pools and the per-instance bookkeeping all use.
      Parameters:
      destination - the table whose instance the key names
      Returns:
      the instance key
    • settings

      public static com.google.cloud.bigtable.data.v2.BigtableDataSettings.Builder settings(TableDestination destination, @Nullable String appProfileId, @Nullable EmulatorEndpoint emulatorEndpoint, @Nullable com.google.api.gax.core.CredentialsProvider credentialsOverride)
      Builds the settings for a client that talks to a destination's instance.
      Parameters:
      destination - the table whose project and instance the client is bound to; the table itself is named per call, not in the settings
      appProfileId - the application profile to route through, or null for the instance's default
      emulatorEndpoint - the emulator to connect to (plaintext, no credentials), or null for production Bigtable
      credentialsOverride - the runtime-loaded service-account provider, or null to preserve application-default credentials
      Returns:
      the settings builder, for the caller to tune and build