Class BigtableDataSettings.Builder (2.49.0)

public static class BigtableDataSettings.Builder

Builder for BigtableDataSettings.

Inheritance

java.lang.Object > BigtableDataSettings.Builder

Methods

build()

public BigtableDataSettings build()
Returns
Type Description
BigtableDataSettings

disableBatchMutationLatencyBasedThrottling()

public BigtableDataSettings.Builder disableBatchMutationLatencyBasedThrottling()

Disable latency based throttling for BigtableDataClient#newBulkMutationBatcher(String).

Returns
Type Description
BigtableDataSettings.Builder

enableBatchMutationLatencyBasedThrottling(long targetRpcLatencyMs)

public BigtableDataSettings.Builder enableBatchMutationLatencyBasedThrottling(long targetRpcLatencyMs)

Enable latency based throttling for BigtableDataClient#newBulkMutationBatcher(String) with a target rpc latency. The number of allowed in-flight requests will be adjusted to reach the target bulk mutations rpc latency.

The logic of adjusting in-flight request limits is as follows:

 To start, Batcher allows FlowController#getCurrentElementCountLimit()
 in-flight elements with a total size of FlowController#getCurrentRequestBytesLimit().

 Every 20 seconds, Batcher checks the mean rpc latency of the requests and compare
 it with the target rpc latency:
   if (mean latency > 3 * target latency) {
     decrease element count limit by 30% of FlowController#getMaxElementCountLimit()
   } else if (mean latency > 1.2 * target latency) {
     decrease element count limit by 10% of FlowController#getMaxElementCountLimit()
   } else if (there was throttling in the past 5 minutes
        && mean latency < 0.8 * target latency) {
     increase element count limit by 5% of FlowController#getMaxElementCountLimit()
   } else if (there was throttling in the past 5 minutes
        && parallelism is 5% of FlowController#getMaxElementCountLimit()
        && mean latency < 2 * target latency) {
     increase element count limit by 2% of FlowController#getMaxElementCountLimit()

 Increases are capped by FlowController#getMaxElementCountLimit(), Decreases are floored at FlowController#getMinElementCountLimit() so that there is some level of throughput.
 

See Also: BigtableBatchingCallSettings.Builder#getDynamicFlowControlSettings()for explanation on default configurations.

Parameter
Name Description
targetRpcLatencyMs long
Returns
Type Description
BigtableDataSettings.Builder

getAppProfileId()

public String getAppProfileId()

Gets the app profile id that was previously set on this Builder.

Returns
Type Description
String

getCredentialsProvider()

public CredentialsProvider getCredentialsProvider()

Gets the CredentialsProvider to use for getting the credentials to make calls with.

Returns
Type Description
CredentialsProvider

getInstanceId()

public String getInstanceId()

Gets the instance id that was previously set on this Builder.

Returns
Type Description
String

getMetricsProvider()

public MetricsProvider getMetricsProvider()

Gets the MetricsProvider.

Returns
Type Description
com.google.cloud.bigtable.data.v2.stub.metrics.MetricsProvider

getPrimingTableIds() (deprecated)

public List<String> getPrimingTableIds()

Deprecated. This field is ignored. If #isRefreshingChannel() is enabled, warm up requests will be sent to all table ids of the instance.

Returns
Type Description
List<String>

getProjectId()

public String getProjectId()

Gets the project id that was previously set on this Builder.

Returns
Type Description
String

getTargetRpcLatencyMsForBatchMutation()

public Long getTargetRpcLatencyMsForBatchMutation()

Gets target bulk mutation rpc latency if latency based throttling is enabled for BigtableDataClient#newBulkMutationBatcher(String). Otherwise returns null.

Returns
Type Description
Long

isBulkMutationFlowControlEnabled()

public boolean isBulkMutationFlowControlEnabled()

Gets if flow control is enabled for BigtableDataClient#newBulkMutationBatcher(String) based on the load of the Bigtable server.

Returns
Type Description
boolean

isLatencyBasedThrottlingForBatchMutationEnabled()

public boolean isLatencyBasedThrottlingForBatchMutationEnabled()

Gets if latency based throttling is enabled for BigtableDataClient#newBulkMutationBatcher(String)

Returns
Type Description
boolean

isRefreshingChannel() (deprecated)

public boolean isRefreshingChannel()

Deprecated. Channel refreshing is enabled by default and this method will be deprecated.

Gets if channels will gracefully refresh connections to Cloud Bigtable service.

Returns
Type Description
boolean

setAppProfileId(String appProfileId)

public BigtableDataSettings.Builder setAppProfileId(String appProfileId)

Sets the AppProfile to use.

An application profile (sometimes also shortened to "app profile") is a group of configuration parameters for an individual use case. A client will identify itself with an application profile ID at connection time, and the requests will be handled according to that application profile.

Parameter
Name Description
appProfileId String
Returns
Type Description
BigtableDataSettings.Builder

setBulkMutationFlowControl(boolean isEnableFlowControl)

public BigtableDataSettings.Builder setBulkMutationFlowControl(boolean isEnableFlowControl)

Configure flow control for BigtableDataClient#newBulkMutationBatcher(String) based on the current load on the Bigtable cluster.

This is different from the FlowController that's always enabled on batch reads and batch writes, which limits the number of outstanding requests to the Bigtable server.

Parameter
Name Description
isEnableFlowControl boolean
Returns
Type Description
BigtableDataSettings.Builder

setCredentialsProvider(CredentialsProvider credentialsProvider)

public BigtableDataSettings.Builder setCredentialsProvider(CredentialsProvider credentialsProvider)

Sets the CredentialsProvider to use for getting the credentials to make calls with.

Parameter
Name Description
credentialsProvider CredentialsProvider
Returns
Type Description
BigtableDataSettings.Builder

setDefaultAppProfileId()

public BigtableDataSettings.Builder setDefaultAppProfileId()

Resets the AppProfile id to the default for the instance.

An application profile (sometimes also shortened to "app profile") is a group of configuration parameters for an individual use case. A client will identify itself with an application profile ID at connection time, and the requests will be handled according to that application profile.

Every Bigtable Instance has a default application profile associated with it, this method configures the client to use it.

Returns
Type Description
BigtableDataSettings.Builder

setInstanceId(String instanceId)

public BigtableDataSettings.Builder setInstanceId(String instanceId)

Sets the target instance. This setting is required. All RPCs will be made in the context of this setting.

Parameter
Name Description
instanceId String
Returns
Type Description
BigtableDataSettings.Builder

setMetricsProvider(MetricsProvider metricsProvider)

public BigtableDataSettings.Builder setMetricsProvider(MetricsProvider metricsProvider)

Sets the MetricsProvider.

By default, this is set to com.google.cloud.bigtable.data.v2.stub.metrics.DefaultMetricsProvider#INSTANCE which will collect and export client side metrics.

To disable client side metrics, set it to com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider#INSTANCE.

To use a custom OpenTelemetry instance, refer to com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider on how to set it up.

Parameter
Name Description
metricsProvider com.google.cloud.bigtable.data.v2.stub.metrics.MetricsProvider
Returns
Type Description
BigtableDataSettings.Builder

setPrimingTableIds(String[] tableIds) (deprecated)

public BigtableDataSettings.Builder setPrimingTableIds(String[] tableIds)

Deprecated. This field is ignored. If #isRefreshingChannel() is enabled, warm up requests will be sent to all table ids of the instance.

Parameter
Name Description
tableIds String[]
Returns
Type Description
BigtableDataSettings.Builder

setProjectId(String projectId)

public BigtableDataSettings.Builder setProjectId(String projectId)

Sets the target project. This setting is required. All RPCs will be made in the context of this setting.

Parameter
Name Description
projectId String
Returns
Type Description
BigtableDataSettings.Builder

setRefreshingChannel(boolean isRefreshingChannel) (deprecated)

public BigtableDataSettings.Builder setRefreshingChannel(boolean isRefreshingChannel)

Deprecated. Channel refreshing is enabled by default and this method will be deprecated.

Configure periodic gRPC channel refreshes.

This feature will gracefully refresh connections to the Cloud Bigtable service. This is a feature to address tail latency caused by the service dropping long lived gRPC connections, which causes the client to renegotiate the gRPC connection in the request path, which causes periodic spikes in latency.

Parameter
Name Description
isRefreshingChannel boolean
Returns
Type Description
BigtableDataSettings.Builder

stubSettings()

public EnhancedBigtableStubSettings.Builder stubSettings()

Returns the underlying settings for making RPC calls. The settings should be changed with care.

Returns
Type Description
EnhancedBigtableStubSettings.Builder