public static class BigtableDataSettings.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
BigtableDataSettings |
build() |
BigtableDataSettings.Builder |
disableBatchMutationLatencyBasedThrottling()
Disable latency based throttling for
BigtableDataClient.newBulkMutationBatcher(String). |
BigtableDataSettings.Builder |
enableBatchMutationLatencyBasedThrottling(long targetRpcLatencyMs)
Enable latency based throttling for
BigtableDataClient.newBulkMutationBatcher(String)
with a target rpc latency. |
String |
getAppProfileId()
Gets the app profile id that was previously set on this Builder.
|
com.google.api.gax.core.CredentialsProvider |
getCredentialsProvider()
Gets the CredentialsProvider to use for getting the credentials to make calls with.
|
String |
getInstanceId()
Gets the instance id that was previously set on this Builder.
|
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. |
String |
getProjectId()
Gets the project id that was previously set on this Builder.
|
Long |
getTargetRpcLatencyMsForBatchMutation()
Gets target bulk mutation rpc latency if latency based throttling is enabled for
BigtableDataClient.newBulkMutationBatcher(String). |
boolean |
isLatencyBasedThrottlingForBatchMutationEnabled()
Gets if latency based throttling is enabled for
BigtableDataClient.newBulkMutationBatcher(String) |
boolean |
isRefreshingChannel()
Gets if channels will gracefully refresh connections to Cloud Bigtable service
|
BigtableDataSettings.Builder |
setAppProfileId(String appProfileId)
Sets the AppProfile to use.
|
BigtableDataSettings.Builder |
setCredentialsProvider(com.google.api.gax.core.CredentialsProvider credentialsProvider)
Sets the CredentialsProvider to use for getting the credentials to make calls with.
|
BigtableDataSettings.Builder |
setDefaultAppProfileId()
Resets the AppProfile id to the default for the instance.
|
BigtableDataSettings.Builder |
setInstanceId(String instanceId)
Sets the target instance.
|
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. |
BigtableDataSettings.Builder |
setProjectId(String projectId)
Sets the target project.
|
BigtableDataSettings.Builder |
setRefreshingChannel(boolean isRefreshingChannel)
Configure periodic gRPC channel refreshes.
|
EnhancedBigtableStubSettings.Builder |
stubSettings()
Returns the underlying settings for making RPC calls.
|
public BigtableDataSettings.Builder setProjectId(@Nonnull String projectId)
public String getProjectId()
public BigtableDataSettings.Builder setInstanceId(@Nonnull String instanceId)
public String getInstanceId()
public BigtableDataSettings.Builder setAppProfileId(@Nonnull String appProfileId)
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.
public BigtableDataSettings.Builder setDefaultAppProfileId()
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.
public String getAppProfileId()
public BigtableDataSettings.Builder setCredentialsProvider(com.google.api.gax.core.CredentialsProvider credentialsProvider)
public com.google.api.gax.core.CredentialsProvider getCredentialsProvider()
@BetaApi(value="Channel priming is not currently stable and may change in the future") public BigtableDataSettings.Builder setRefreshingChannel(boolean isRefreshingChannel)
This feature will gracefully refresh connections to the Cloud Bigtable service. This is an experimental 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
@BetaApi(value="Channel priming is not currently stable and may change in the future") public boolean isRefreshingChannel()
@Deprecated public BigtableDataSettings.Builder setPrimingTableIds(String... tableIds)
isRefreshingChannel() is enabled, warm up
requests will be sent to all table ids of the instance.@Deprecated public List<String> getPrimingTableIds()
isRefreshingChannel() is enabled, warm up
requests will be sent to all table ids of the instance.@BetaApi(value="Latency based throttling is not currently stable and may change in the future") public BigtableDataSettings.Builder enableBatchMutationLatencyBasedThrottling(long targetRpcLatencyMs)
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,BatcherallowsFlowController.getCurrentElementCountLimit()in-flight elements with a total size ofFlowController.getCurrentRequestBytesLimit(). Every 20 seconds,Batcherchecks 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.
for explanation on
default configurations.@BetaApi(value="Latency based throttling is not currently stable and may change in the future") public BigtableDataSettings.Builder disableBatchMutationLatencyBasedThrottling()
BigtableDataClient.newBulkMutationBatcher(String).@BetaApi(value="Latency based throttling is not currently stable and may change in the future") public boolean isLatencyBasedThrottlingForBatchMutationEnabled()
BigtableDataClient.newBulkMutationBatcher(String)@BetaApi(value="Latency based throttling is not currently stable and may change in the future") @Nullable public Long getTargetRpcLatencyMsForBatchMutation()
BigtableDataClient.newBulkMutationBatcher(String). Otherwise returns null.public EnhancedBigtableStubSettings.Builder stubSettings()
public BigtableDataSettings build()
Copyright © 2022 Google LLC. All rights reserved.