Class SpannerConfig

java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.SpannerConfig
All Implemented Interfaces:
Serializable

public abstract class SpannerConfig extends Object implements Serializable
Configuration for a Cloud Spanner client.
See Also:
  • Constructor Details

    • SpannerConfig

      public SpannerConfig()
  • Method Details

    • getProjectId

      public abstract @Nullable ValueProvider<String> getProjectId()
    • getInstanceId

      public abstract @Nullable ValueProvider<String> getInstanceId()
    • getDatabaseId

      public abstract @Nullable ValueProvider<String> getDatabaseId()
    • getHost

      public abstract @Nullable ValueProvider<String> getHost()
    • getHostValue

      public String getHostValue()
    • getEmulatorHost

      public abstract @Nullable ValueProvider<String> getEmulatorHost()
    • getIsLocalChannelProvider

      public abstract @Nullable ValueProvider<Boolean> getIsLocalChannelProvider()
    • getCommitDeadline

      public abstract @Nullable ValueProvider<Duration> getCommitDeadline()
    • getMaxCumulativeBackoff

      public abstract @Nullable ValueProvider<Duration> getMaxCumulativeBackoff()
    • getExecuteStreamingSqlRetrySettings

      public abstract @Nullable com.google.api.gax.retrying.RetrySettings getExecuteStreamingSqlRetrySettings()
    • getCommitRetrySettings

      public abstract @Nullable com.google.api.gax.retrying.RetrySettings getCommitRetrySettings()
    • getRetryableCodes

      public abstract @Nullable org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableSet<com.google.api.gax.rpc.StatusCode.Code> getRetryableCodes()
    • getRpcPriority

      public abstract @Nullable ValueProvider<Options.RpcPriority> getRpcPriority()
    • getMaxCommitDelay

      public abstract @Nullable ValueProvider<Duration> getMaxCommitDelay()
    • getDatabaseRole

      public abstract @Nullable ValueProvider<String> getDatabaseRole()
    • getPartitionQueryTimeout

      public abstract @Nullable ValueProvider<Duration> getPartitionQueryTimeout()
    • getPartitionReadTimeout

      public abstract @Nullable ValueProvider<Duration> getPartitionReadTimeout()
    • getDataBoostEnabled

      public abstract @Nullable ValueProvider<Boolean> getDataBoostEnabled()
    • getCredentials

      public abstract @Nullable ValueProvider<com.google.auth.Credentials> getCredentials()
    • create

      public static SpannerConfig create()
    • validate

      public void validate()
    • populateDisplayData

      public void populateDisplayData(DisplayData.Builder builder)
    • withProjectId

      public SpannerConfig withProjectId(ValueProvider<String> projectId)
      Specifies the Cloud Spanner project ID.
    • withProjectId

      public SpannerConfig withProjectId(String projectId)
      Specifies the Cloud Spanner project ID.
    • withInstanceId

      public SpannerConfig withInstanceId(ValueProvider<String> instanceId)
      Specifies the Cloud Spanner instance ID.
    • withInstanceId

      public SpannerConfig withInstanceId(String instanceId)
      Specifies the Cloud Spanner instance ID.
    • withDatabaseId

      public SpannerConfig withDatabaseId(ValueProvider<String> databaseId)
      Specifies the Cloud Spanner database ID.
    • withDatabaseId

      public SpannerConfig withDatabaseId(String databaseId)
      Specifies the Cloud Spanner database ID.
    • withHost

      public SpannerConfig withHost(ValueProvider<String> host)
      Specifies the Cloud Spanner host.
    • withEmulatorHost

      public SpannerConfig withEmulatorHost(ValueProvider<String> emulatorHost)
      Specifies the Cloud Spanner host, when an emulator is used.
    • withIsLocalChannelProvider

      public SpannerConfig withIsLocalChannelProvider(ValueProvider<Boolean> isLocalChannelProvider)
      Specifies whether a local channel provider should be used. This should be set to True when an emulator is used.
    • withCommitDeadline

      public SpannerConfig withCommitDeadline(Duration commitDeadline)
      Specifies the commit deadline. This is overridden if the CommitRetrySettings is specified.
    • withCommitDeadline

      public SpannerConfig withCommitDeadline(ValueProvider<Duration> commitDeadline)
      Specifies the commit deadline. This is overridden if the CommitRetrySettings is specified.
    • withMaxCumulativeBackoff

      public SpannerConfig withMaxCumulativeBackoff(Duration maxCumulativeBackoff)
      Specifies the maximum cumulative backoff.
    • withMaxCumulativeBackoff

      public SpannerConfig withMaxCumulativeBackoff(ValueProvider<Duration> maxCumulativeBackoff)
      Specifies the maximum cumulative backoff.
    • withExecuteStreamingSqlRetrySettings

      public SpannerConfig withExecuteStreamingSqlRetrySettings(com.google.api.gax.retrying.RetrySettings executeStreamingSqlRetrySettings)
      Specifies the ExecuteStreamingSql retry settings. If not set, the default timeout is set to 2 hours.
    • withCommitRetrySettings

      public SpannerConfig withCommitRetrySettings(com.google.api.gax.retrying.RetrySettings commitRetrySettings)
      Specifies the commit retry settings. Setting this overrides the commit deadline.
    • withRetryableCodes

      public SpannerConfig withRetryableCodes(org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableSet<com.google.api.gax.rpc.StatusCode.Code> retryableCodes)
      Specifies the errors that will be retried by the client library for all operations.
    • withRpcPriority

      public SpannerConfig withRpcPriority(Options.RpcPriority rpcPriority)
      Specifies the RPC priority.
    • withRpcPriority

      public SpannerConfig withRpcPriority(ValueProvider<Options.RpcPriority> rpcPriority)
      Specifies the RPC priority.
    • withMaxCommitDelay

      public SpannerConfig withMaxCommitDelay(long millis)
    • withMaxCommitDelay

      public SpannerConfig withMaxCommitDelay(Duration maxCommitDelay)
      Specifies the max commit delay for high throughput writes.
    • withMaxCommitDelay

      public SpannerConfig withMaxCommitDelay(ValueProvider<Duration> maxCommitDelay)
      Specifies the max commit delay for high throughput writes.
    • withDatabaseRole

      public SpannerConfig withDatabaseRole(ValueProvider<String> databaseRole)
      Specifies the Cloud Spanner database role.
    • withDataBoostEnabled

      public SpannerConfig withDataBoostEnabled(ValueProvider<Boolean> dataBoostEnabled)
      Specifies if the pipeline has to be run on the independent compute resource.
    • withPartitionQueryTimeout

      public SpannerConfig withPartitionQueryTimeout(Duration partitionQueryTimeout)
      Specifies the PartitionQuery timeout.
    • withPartitionQueryTimeout

      public SpannerConfig withPartitionQueryTimeout(ValueProvider<Duration> partitionQueryTimeout)
      Specifies the PartitionQuery timeout.
    • withPartitionReadTimeout

      public SpannerConfig withPartitionReadTimeout(Duration partitionReadTimeout)
      Specifies the PartitionRead timeout.
    • withPartitionReadTimeout

      public SpannerConfig withPartitionReadTimeout(ValueProvider<Duration> partitionReadTimeout)
      Specifies the PartitionRead timeout.
    • withCredentials

      public SpannerConfig withCredentials(com.google.auth.Credentials credentials)
      Specifies the credentials.
    • withCredentials

      public SpannerConfig withCredentials(ValueProvider<com.google.auth.Credentials> credentials)
      Specifies the credentials.