public final class BigtableDataSettings extends Object
BigtableDataClient
.
Sane defaults are provided for most settings:
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()
.
Modifier and Type | Class and Description |
---|---|
static class |
BigtableDataSettings.Builder
Builder for BigtableDataSettings.
|
Modifier and Type | Method and Description |
---|---|
static void |
enableOpenCensusStats()
Enables OpenCensus metric aggregations.
|
String |
getAppProfileId()
Returns the configured AppProfile id to use.
|
String |
getInstanceId()
Returns the target instance id.
|
String |
getProjectId()
Returns the target project id.
|
EnhancedBigtableStubSettings |
getStubSettings()
Returns the underlying RPC settings.
|
static BigtableDataSettings.Builder |
newBuilder()
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.
|
com.google.api.gax.rpc.UnaryCallSettings<Query,Row> |
readRowSettings()
Returns the object with the settings used for point reads via ReadRow.
|
BigtableDataSettings.Builder |
toBuilder()
Returns a builder containing all the values of this settings class.
|
public static BigtableDataSettings.Builder newBuilder()
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.
public static BigtableDataSettings.Builder newBuilderForEmulator(int port)
public static BigtableDataSettings.Builder newBuilderForEmulator(String hostname, int port)
@BetaApi(value="OpenCensus stats integration is currently unstable and may change in the future") public static void enableOpenCensusStats()
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:
Example usage for maven:
Java:io.opencensus opencensus-impl ${opencensus.version} runtime io.opencensus opencensus-exporter-stats-stackdriver ${opencensus.version}
{@code StackdriverStatsExporter.createAndRegister(); BigtableDataSettings.enableOpenCensusStats(); }
public String getProjectId()
public String getInstanceId()
public String getAppProfileId()
public EnhancedBigtableStubSettings getStubSettings()
public com.google.api.gax.rpc.UnaryCallSettings<Query,Row> readRowSettings()
public BigtableDataSettings.Builder toBuilder()
Copyright © 2019 Google LLC. All rights reserved.