Class BigtableDataSettings
BigtableDataClient
.
Sane defaults are provided for most settings:
- The default service address (bigtable.googleapis.com) and default port (443) are used.
- The transport provider is configured with a channel pool that contains twice as many connections as CPUs.
- Credentials are acquired automatically through Application Default Credentials.
- Retries are configured for idempotent methods but not for non-idempotent methods.
The only required setting is the instance name.
The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.
BigtableDataSettings.Builder settingsBuilder = BigtableDataSettings.newBuilder()
.setProjectId("my-project")
.setInstanceId("my-instance-id")
.setAppProfileId("default");
BigtableDataSettings settings = builder.build();
For fine grained control of individual RPCs, please refer to EnhancedBigtableStubSettings
, which is exposed as BigtableDataSettings.Builder.stubSettings()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder for BigtableDataSettings. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Register built in metrics.static void
enableBuiltinMetrics
(com.google.auth.Credentials credentials) Register built in metrics with credentials.static void
Enables OpenCensus GFE metric aggregations.static void
Enables OpenCensus metric aggregations.Returns the configured AppProfile id to use.Gets target bulk mutation rpc latency if latency based throttling is enabled forBigtableDataClient.newBulkMutationBatcher(String)
.Returns the target instance id.Deprecated.This field is ignored.Returns the target project id.Returns the underlying RPC settings.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.static BigtableDataSettings.Builder
Create a new builder.static BigtableDataSettings.Builder
newBuilderForEmulator
(int port) Create a new builder preconfigured to connect to the Bigtable emulator with port number.static BigtableDataSettings.Builder
newBuilderForEmulator
(String hostname, int port) Creates a new builder preconfigured to connect to the Bigtable emulator with a host name and port number.Returns the object with the settings used for point reads via ReadRow.Returns a builder containing all the values of this settings class.toString()
-
Method Details
-
newBuilder
Create a new builder.If emulator configuration provided in BIGTABLE_EMULATOR_HOST environment variable then it creates a builder preconfigured to connect to Bigtable using emulator hostname and port number.
-
newBuilderForEmulator
Create a new builder preconfigured to connect to the Bigtable emulator with port number. -
newBuilderForEmulator
Creates a new builder preconfigured to connect to the Bigtable emulator with a host name and port number. -
enableOpenCensusStats
@BetaApi("OpenCensus stats integration is currently unstable and may change in the future") public static void enableOpenCensusStats()Enables OpenCensus metric aggregations.This will register Bigtable client relevant
View
s. When coupled with an exporter, it allows users to monitor client behavior.Please note that in addition to calling this method, the application must:
- Include openensus-impl dependency on the classpath
- Configure an exporter like opencensus-exporter-stats-stackdriver
Example usage for maven:
{@code <dependency> <groupId>io.opencensus</groupId> <artifactId>opencensus-impl</artifactId> <version>${opencensus.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>io.opencensus</groupId> <artifactId>opencensus-exporter-stats-stackdriver</artifactId> <version>${opencensus.version}</version> </dependency> </pre> Java: <pre>{@code StackdriverStatsExporter.createAndRegister(); BigtableDataSettings.enableOpenCensusStats(); }</pre>
-
enableGfeOpenCensusStats
@BetaApi("OpenCensus stats integration is currently unstable and may change in the future") public static void enableGfeOpenCensusStats()Enables OpenCensus GFE metric aggregations.This will register views for gfe_latency and gfe_header_missing_count metrics.
gfe_latency measures the latency between Google's network receives an RPC and reads back the first byte of the response. gfe_header_missing_count is a counter of the number of RPC responses received without the server-timing header.
-
enableBuiltinMetrics
Register built in metrics.- Throws:
IOException
-
enableBuiltinMetrics
Register built in metrics with credentials. The credentials need to have metric write access for all the projects you're publishing to.- Throws:
IOException
-
getProjectId
Returns the target project id. -
getInstanceId
Returns the target instance id. -
getAppProfileId
Returns the configured AppProfile id to use. -
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 -
getPrimingTableIds
Deprecated.This field is ignored. IfisRefreshingChannel()
is enabled, warm up requests will be sent to all table ids of the instance. -
isLatencyBasedThrottlingForBatchMutationsEnabled
@BetaApi("Latency based throttling is not currently stable and may change in the future") public boolean isLatencyBasedThrottlingForBatchMutationsEnabled()Gets if latency based throttling is enabled forBigtableDataClient.newBulkMutationBatcher(String)
-
getBatchMutationsTargetRpcLatencyMs
@BetaApi("Latency based throttling is not currently stable and may change in the future") @Nullable public Long getBatchMutationsTargetRpcLatencyMs()Gets target bulk mutation rpc latency if latency based throttling is enabled forBigtableDataClient.newBulkMutationBatcher(String)
. Otherwise returns null. -
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. -
getStubSettings
Returns the underlying RPC settings. -
readRowSettings
Returns the object with the settings used for point reads via ReadRow. -
toString
-
toBuilder
Returns a builder containing all the values of this settings class.
-