Class BigtableDataSettings.Builder
- Enclosing class:
- BigtableDataSettings
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Disable latency based throttling forBigtableDataClient.newBulkMutationBatcher(String)
.enableBatchMutationLatencyBasedThrottling
(long targetRpcLatencyMs) Enable latency based throttling forBigtableDataClient.newBulkMutationBatcher(String)
with a target rpc latency.Gets the app profile id that was previously set on this Builder.com.google.api.gax.core.CredentialsProvider
Gets the CredentialsProvider to use for getting the credentials to make calls with.Gets the instance id that was previously set on this Builder.Deprecated.This field is ignored.Gets the project id that was previously set on this Builder.Gets target bulk mutation rpc latency if latency based throttling is enabled forBigtableDataClient.newBulkMutationBatcher(String)
.boolean
Gets if flow control is enabled forBigtableDataClient.newBulkMutationBatcher(String)
based on the load of the Bigtable server.boolean
Gets if latency based throttling is enabled forBigtableDataClient.newBulkMutationBatcher(String)
boolean
Deprecated.Channel refreshing is enabled by default and this method will be deprecated.setAppProfileId
(String appProfileId) Sets the AppProfile to use.setBulkMutationFlowControl
(boolean isEnableFlowControl) Configure flow control forBigtableDataClient.newBulkMutationBatcher(String)
based on the current load on the Bigtable cluster.setCredentialsProvider
(com.google.api.gax.core.CredentialsProvider credentialsProvider) Sets the CredentialsProvider to use for getting the credentials to make calls with.Resets the AppProfile id to the default for the instance.setInstanceId
(String instanceId) Sets the target instance.setPrimingTableIds
(String... tableIds) Deprecated.This field is ignored.setProjectId
(String projectId) Sets the target project.setRefreshingChannel
(boolean isRefreshingChannel) Deprecated.Channel refreshing is enabled by default and this method will be deprecated.Returns the underlying settings for making RPC calls.
-
Method Details
-
setProjectId
Sets the target project. This setting is required. All RPCs will be made in the context of this setting. -
getProjectId
Gets the project id that was previously set on this Builder. -
setInstanceId
Sets the target instance. This setting is required. All RPCs will be made in the context of this setting. -
getInstanceId
Gets the instance id that was previously set on this Builder. -
setAppProfileId
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.
-
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.
-
getAppProfileId
Gets the app profile id that was previously set on this Builder. -
setCredentialsProvider
public BigtableDataSettings.Builder setCredentialsProvider(com.google.api.gax.core.CredentialsProvider credentialsProvider) Sets the CredentialsProvider to use for getting the credentials to make calls with. -
getCredentialsProvider
public com.google.api.gax.core.CredentialsProvider getCredentialsProvider()Gets the CredentialsProvider to use for getting the credentials to make calls with. -
setRefreshingChannel
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.
-
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. -
setPrimingTableIds
Deprecated.This field is ignored. IfisRefreshingChannel()
is enabled, warm up requests will be sent to all table ids of the instance. -
getPrimingTableIds
Deprecated.This field is ignored. IfisRefreshingChannel()
is enabled, warm up requests will be sent to all table ids of the instance. -
enableBatchMutationLatencyBasedThrottling
@BetaApi("Latency based throttling is not currently stable and may change in the future") public BigtableDataSettings.Builder enableBatchMutationLatencyBasedThrottling(long targetRpcLatencyMs) Enable latency based throttling forBigtableDataClient.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
allowsFlowController.getCurrentElementCountLimit()
in-flight elements with a total size ofFlowController.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% ofFlowController.getMaxElementCountLimit()
} else if (mean latency > 1.2 * target latency) { decrease element count limit by 10% ofFlowController.getMaxElementCountLimit()
} else if (there was throttling in the past 5 minutes && mean latency < 0.8 * target latency) { increase element count limit by 5% ofFlowController.getMaxElementCountLimit()
} else if (there was throttling in the past 5 minutes && parallelism is 5% ofFlowController.getMaxElementCountLimit()
&& mean latency < 2 * target latency) { increase element count limit by 2% ofFlowController.getMaxElementCountLimit()
Increases are capped byFlowController.getMaxElementCountLimit()
, Decreases are floored atFlowController.getMinElementCountLimit()
so that there is some level of throughput.- See Also:
-
for explanation on default configurations.
-
disableBatchMutationLatencyBasedThrottling
@BetaApi("Latency based throttling is not currently stable and may change in the future") public BigtableDataSettings.Builder disableBatchMutationLatencyBasedThrottling()Disable latency based throttling forBigtableDataClient.newBulkMutationBatcher(String)
. -
isLatencyBasedThrottlingForBatchMutationEnabled
@BetaApi("Latency based throttling is not currently stable and may change in the future") public boolean isLatencyBasedThrottlingForBatchMutationEnabled()Gets if latency based throttling is enabled forBigtableDataClient.newBulkMutationBatcher(String)
-
getTargetRpcLatencyMsForBatchMutation
@BetaApi("Latency based throttling is not currently stable and may change in the future") @Nullable public Long getTargetRpcLatencyMsForBatchMutation()Gets target bulk mutation rpc latency if latency based throttling is enabled forBigtableDataClient.newBulkMutationBatcher(String)
. Otherwise returns null. -
setBulkMutationFlowControl
@InternalApi("Intended for use by the Bigtable dataflow connectors only") public BigtableDataSettings.Builder setBulkMutationFlowControl(boolean isEnableFlowControl) Configure flow control forBigtableDataClient.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. -
isBulkMutationFlowControlEnabled
@InternalApi("Intended for use by the Bigtable dataflow connectors only") public boolean isBulkMutationFlowControlEnabled()Gets if flow control is enabled forBigtableDataClient.newBulkMutationBatcher(String)
based on the load of the Bigtable server. -
stubSettings
Returns the underlying settings for making RPC calls. The settings should be changed with care. -
build
-