@Generated(value="by gapic-generator") @BetaApi public class BaseBigtableTableAdminClient extends Object implements BackgroundResource
Provides access to the table schemas only, not the data stored within the tables.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
Table table = Table.newBuilder().build();
Table response = baseBigtableTableAdminClient.createTable(parent, tableId, table);
}
Note: close() needs to be called on the baseBigtableTableAdminClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of BaseBigtableTableAdminSettings to create(). For example:
To customize credentials:
BaseBigtableTableAdminSettings baseBigtableTableAdminSettings =
BaseBigtableTableAdminSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
BaseBigtableTableAdminClient baseBigtableTableAdminClient =
BaseBigtableTableAdminClient.create(baseBigtableTableAdminSettings);
To customize the endpoint:
BaseBigtableTableAdminSettings baseBigtableTableAdminSettings =
BaseBigtableTableAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
BaseBigtableTableAdminClient baseBigtableTableAdminClient =
BaseBigtableTableAdminClient.create(baseBigtableTableAdminSettings);
Modifier and Type | Class and Description |
---|---|
static class |
BaseBigtableTableAdminClient.ListSnapshotsFixedSizeCollection |
static class |
BaseBigtableTableAdminClient.ListSnapshotsPage |
static class |
BaseBigtableTableAdminClient.ListSnapshotsPagedResponse |
static class |
BaseBigtableTableAdminClient.ListTablesFixedSizeCollection |
static class |
BaseBigtableTableAdminClient.ListTablesPage |
static class |
BaseBigtableTableAdminClient.ListTablesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
BaseBigtableTableAdminClient(BaseBigtableTableAdminSettings settings)
Constructs an instance of BaseBigtableTableAdminClient, using the given settings.
|
protected |
BaseBigtableTableAdminClient(BigtableTableAdminStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.bigtable.admin.v2.CheckConsistencyResponse |
checkConsistency(com.google.bigtable.admin.v2.CheckConsistencyRequest request)
Checks replication consistency based on a consistency token, that is, if replication has caught
up based on the conditions specified in the token and the check request.
|
com.google.bigtable.admin.v2.CheckConsistencyResponse |
checkConsistency(String name,
String consistencyToken)
Checks replication consistency based on a consistency token, that is, if replication has caught
up based on the conditions specified in the token and the check request.
|
com.google.bigtable.admin.v2.CheckConsistencyResponse |
checkConsistency(com.google.bigtable.admin.v2.TableName name,
String consistencyToken)
Checks replication consistency based on a consistency token, that is, if replication has caught
up based on the conditions specified in the token and the check request.
|
UnaryCallable<com.google.bigtable.admin.v2.CheckConsistencyRequest,com.google.bigtable.admin.v2.CheckConsistencyResponse> |
checkConsistencyCallable()
Checks replication consistency based on a consistency token, that is, if replication has caught
up based on the conditions specified in the token and the check request.
|
void |
close() |
static BaseBigtableTableAdminClient |
create()
Constructs an instance of BaseBigtableTableAdminClient with default settings.
|
static BaseBigtableTableAdminClient |
create(BaseBigtableTableAdminSettings settings)
Constructs an instance of BaseBigtableTableAdminClient, using the given settings.
|
static BaseBigtableTableAdminClient |
create(BigtableTableAdminStub stub)
Constructs an instance of BaseBigtableTableAdminClient, using the given stub for making calls.
|
com.google.bigtable.admin.v2.Table |
createTable(com.google.bigtable.admin.v2.CreateTableRequest request)
Creates a new table in the specified instance.
|
com.google.bigtable.admin.v2.Table |
createTable(com.google.bigtable.admin.v2.InstanceName parent,
String tableId,
com.google.bigtable.admin.v2.Table table)
Creates a new table in the specified instance.
|
com.google.bigtable.admin.v2.Table |
createTable(String parent,
String tableId,
com.google.bigtable.admin.v2.Table table)
Creates a new table in the specified instance.
|
UnaryCallable<com.google.bigtable.admin.v2.CreateTableRequest,com.google.bigtable.admin.v2.Table> |
createTableCallable()
Creates a new table in the specified instance.
|
OperationFuture<com.google.bigtable.admin.v2.Table,com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata> |
createTableFromSnapshotAsync(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request)
Creates a new table from the specified snapshot.
|
OperationFuture<com.google.bigtable.admin.v2.Table,com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata> |
createTableFromSnapshotAsync(com.google.bigtable.admin.v2.InstanceName parent,
String tableId,
com.google.bigtable.admin.v2.SnapshotName sourceSnapshot)
Creates a new table from the specified snapshot.
|
OperationFuture<com.google.bigtable.admin.v2.Table,com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata> |
createTableFromSnapshotAsync(String parent,
String tableId,
String sourceSnapshot)
Creates a new table from the specified snapshot.
|
UnaryCallable<com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest,Operation> |
createTableFromSnapshotCallable()
Creates a new table from the specified snapshot.
|
OperationCallable<com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest,com.google.bigtable.admin.v2.Table,com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata> |
createTableFromSnapshotOperationCallable()
Creates a new table from the specified snapshot.
|
void |
deleteSnapshot(com.google.bigtable.admin.v2.DeleteSnapshotRequest request)
Permanently deletes the specified snapshot.
|
void |
deleteSnapshot(com.google.bigtable.admin.v2.SnapshotName name)
Permanently deletes the specified snapshot.
|
void |
deleteSnapshot(String name)
Permanently deletes the specified snapshot.
|
UnaryCallable<com.google.bigtable.admin.v2.DeleteSnapshotRequest,Empty> |
deleteSnapshotCallable()
Permanently deletes the specified snapshot.
|
void |
deleteTable(com.google.bigtable.admin.v2.DeleteTableRequest request)
Permanently deletes a specified table and all of its data.
|
void |
deleteTable(String name)
Permanently deletes a specified table and all of its data.
|
void |
deleteTable(com.google.bigtable.admin.v2.TableName name)
Permanently deletes a specified table and all of its data.
|
UnaryCallable<com.google.bigtable.admin.v2.DeleteTableRequest,Empty> |
deleteTableCallable()
Permanently deletes a specified table and all of its data.
|
void |
dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest request)
Permanently drop/delete a row range from a specified table.
|
UnaryCallable<com.google.bigtable.admin.v2.DropRowRangeRequest,Empty> |
dropRowRangeCallable()
Permanently drop/delete a row range from a specified table.
|
com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse |
generateConsistencyToken(com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request)
Generates a consistency token for a Table, which can be used in CheckConsistency to check
whether mutations to the table that finished before this call started have been replicated.
|
com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse |
generateConsistencyToken(String name)
Generates a consistency token for a Table, which can be used in CheckConsistency to check
whether mutations to the table that finished before this call started have been replicated.
|
com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse |
generateConsistencyToken(com.google.bigtable.admin.v2.TableName name)
Generates a consistency token for a Table, which can be used in CheckConsistency to check
whether mutations to the table that finished before this call started have been replicated.
|
UnaryCallable<com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest,com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse> |
generateConsistencyTokenCallable()
Generates a consistency token for a Table, which can be used in CheckConsistency to check
whether mutations to the table that finished before this call started have been replicated.
|
OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
BaseBigtableTableAdminSettings |
getSettings() |
com.google.bigtable.admin.v2.Snapshot |
getSnapshot(com.google.bigtable.admin.v2.GetSnapshotRequest request)
Gets metadata information about the specified snapshot.
|
com.google.bigtable.admin.v2.Snapshot |
getSnapshot(com.google.bigtable.admin.v2.SnapshotName name)
Gets metadata information about the specified snapshot.
|
com.google.bigtable.admin.v2.Snapshot |
getSnapshot(String name)
Gets metadata information about the specified snapshot.
|
UnaryCallable<com.google.bigtable.admin.v2.GetSnapshotRequest,com.google.bigtable.admin.v2.Snapshot> |
getSnapshotCallable()
Gets metadata information about the specified snapshot.
|
BigtableTableAdminStub |
getStub() |
com.google.bigtable.admin.v2.Table |
getTable(com.google.bigtable.admin.v2.GetTableRequest request)
Gets metadata information about the specified table.
|
com.google.bigtable.admin.v2.Table |
getTable(String name)
Gets metadata information about the specified table.
|
com.google.bigtable.admin.v2.Table |
getTable(com.google.bigtable.admin.v2.TableName name)
Gets metadata information about the specified table.
|
UnaryCallable<com.google.bigtable.admin.v2.GetTableRequest,com.google.bigtable.admin.v2.Table> |
getTableCallable()
Gets metadata information about the specified table.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
BaseBigtableTableAdminClient.ListSnapshotsPagedResponse |
listSnapshots(com.google.bigtable.admin.v2.ClusterName parent)
Lists all snapshots associated with the specified cluster.
|
BaseBigtableTableAdminClient.ListSnapshotsPagedResponse |
listSnapshots(com.google.bigtable.admin.v2.ListSnapshotsRequest request)
Lists all snapshots associated with the specified cluster.
|
BaseBigtableTableAdminClient.ListSnapshotsPagedResponse |
listSnapshots(String parent)
Lists all snapshots associated with the specified cluster.
|
UnaryCallable<com.google.bigtable.admin.v2.ListSnapshotsRequest,com.google.bigtable.admin.v2.ListSnapshotsResponse> |
listSnapshotsCallable()
Lists all snapshots associated with the specified cluster.
|
UnaryCallable<com.google.bigtable.admin.v2.ListSnapshotsRequest,BaseBigtableTableAdminClient.ListSnapshotsPagedResponse> |
listSnapshotsPagedCallable()
Lists all snapshots associated with the specified cluster.
|
BaseBigtableTableAdminClient.ListTablesPagedResponse |
listTables(com.google.bigtable.admin.v2.InstanceName parent)
Lists all tables served from a specified instance.
|
BaseBigtableTableAdminClient.ListTablesPagedResponse |
listTables(com.google.bigtable.admin.v2.ListTablesRequest request)
Lists all tables served from a specified instance.
|
BaseBigtableTableAdminClient.ListTablesPagedResponse |
listTables(String parent)
Lists all tables served from a specified instance.
|
UnaryCallable<com.google.bigtable.admin.v2.ListTablesRequest,com.google.bigtable.admin.v2.ListTablesResponse> |
listTablesCallable()
Lists all tables served from a specified instance.
|
UnaryCallable<com.google.bigtable.admin.v2.ListTablesRequest,BaseBigtableTableAdminClient.ListTablesPagedResponse> |
listTablesPagedCallable()
Lists all tables served from a specified instance.
|
com.google.bigtable.admin.v2.Table |
modifyColumnFamilies(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request)
Performs a series of column family modifications on the specified table.
|
com.google.bigtable.admin.v2.Table |
modifyColumnFamilies(String name,
List<com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification> modifications)
Performs a series of column family modifications on the specified table.
|
com.google.bigtable.admin.v2.Table |
modifyColumnFamilies(com.google.bigtable.admin.v2.TableName name,
List<com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification> modifications)
Performs a series of column family modifications on the specified table.
|
UnaryCallable<com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest,com.google.bigtable.admin.v2.Table> |
modifyColumnFamiliesCallable()
Performs a series of column family modifications on the specified table.
|
void |
shutdown() |
void |
shutdownNow() |
OperationFuture<com.google.bigtable.admin.v2.Snapshot,com.google.bigtable.admin.v2.SnapshotTableMetadata> |
snapshotTableAsync(com.google.bigtable.admin.v2.SnapshotTableRequest request)
Creates a new snapshot in the specified cluster from the specified source table.
|
OperationFuture<com.google.bigtable.admin.v2.Snapshot,com.google.bigtable.admin.v2.SnapshotTableMetadata> |
snapshotTableAsync(String name,
String cluster,
String snapshotId,
String description)
Creates a new snapshot in the specified cluster from the specified source table.
|
OperationFuture<com.google.bigtable.admin.v2.Snapshot,com.google.bigtable.admin.v2.SnapshotTableMetadata> |
snapshotTableAsync(com.google.bigtable.admin.v2.TableName name,
com.google.bigtable.admin.v2.ClusterName cluster,
com.google.bigtable.admin.v2.SnapshotName snapshotId,
String description)
Creates a new snapshot in the specified cluster from the specified source table.
|
UnaryCallable<com.google.bigtable.admin.v2.SnapshotTableRequest,Operation> |
snapshotTableCallable()
Creates a new snapshot in the specified cluster from the specified source table.
|
OperationCallable<com.google.bigtable.admin.v2.SnapshotTableRequest,com.google.bigtable.admin.v2.Snapshot,com.google.bigtable.admin.v2.SnapshotTableMetadata> |
snapshotTableOperationCallable()
Creates a new snapshot in the specified cluster from the specified source table.
|
protected BaseBigtableTableAdminClient(BaseBigtableTableAdminSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected BaseBigtableTableAdminClient(BigtableTableAdminStub stub)
public static final BaseBigtableTableAdminClient create() throws IOException
IOException
public static final BaseBigtableTableAdminClient create(BaseBigtableTableAdminSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final BaseBigtableTableAdminClient create(BigtableTableAdminStub stub)
public final BaseBigtableTableAdminSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public BigtableTableAdminStub getStub()
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient()
public final com.google.bigtable.admin.v2.Table createTable(com.google.bigtable.admin.v2.InstanceName parent, String tableId, com.google.bigtable.admin.v2.Table table)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
Table table = Table.newBuilder().build();
Table response = baseBigtableTableAdminClient.createTable(parent, tableId, table);
}
parent
- The unique name of the instance in which to create the table. Values are of the
form `projects/<project>/instances/<instance>`.tableId
- The name by which the new table should be referred to within the parent
instance, e.g., `foobar` rather than `<parent>/tables/foobar`.table
- The Table to create.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.Table createTable(String parent, String tableId, com.google.bigtable.admin.v2.Table table)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
Table table = Table.newBuilder().build();
Table response = baseBigtableTableAdminClient.createTable(parent.toString(), tableId, table);
}
parent
- The unique name of the instance in which to create the table. Values are of the
form `projects/<project>/instances/<instance>`.tableId
- The name by which the new table should be referred to within the parent
instance, e.g., `foobar` rather than `<parent>/tables/foobar`.table
- The Table to create.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.Table createTable(com.google.bigtable.admin.v2.CreateTableRequest request)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
Table table = Table.newBuilder().build();
CreateTableRequest request = CreateTableRequest.newBuilder()
.setParent(parent.toString())
.setTableId(tableId)
.setTable(table)
.build();
Table response = baseBigtableTableAdminClient.createTable(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.CreateTableRequest,com.google.bigtable.admin.v2.Table> createTableCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
Table table = Table.newBuilder().build();
CreateTableRequest request = CreateTableRequest.newBuilder()
.setParent(parent.toString())
.setTableId(tableId)
.setTable(table)
.build();
ApiFuture<Table> future = baseBigtableTableAdminClient.createTableCallable().futureCall(request);
// Do something
Table response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.bigtable.admin.v2.Table,com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata> createTableFromSnapshotAsync(com.google.bigtable.admin.v2.InstanceName parent, String tableId, com.google.bigtable.admin.v2.SnapshotName sourceSnapshot)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
SnapshotName sourceSnapshot = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
Table response = baseBigtableTableAdminClient.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get();
}
parent
- The unique name of the instance in which to create the table. Values are of the
form `projects/<project>/instances/<instance>`.tableId
- The name by which the new table should be referred to within the parent
instance, e.g., `foobar` rather than `<parent>/tables/foobar`.sourceSnapshot
- The unique name of the snapshot from which to restore the table. The
snapshot and the table must be in the same instance. Values are of the form
`projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.bigtable.admin.v2.Table,com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata> createTableFromSnapshotAsync(String parent, String tableId, String sourceSnapshot)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
SnapshotName sourceSnapshot = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
Table response = baseBigtableTableAdminClient.createTableFromSnapshotAsync(parent.toString(), tableId, sourceSnapshot.toString()).get();
}
parent
- The unique name of the instance in which to create the table. Values are of the
form `projects/<project>/instances/<instance>`.tableId
- The name by which the new table should be referred to within the parent
instance, e.g., `foobar` rather than `<parent>/tables/foobar`.sourceSnapshot
- The unique name of the snapshot from which to restore the table. The
snapshot and the table must be in the same instance. Values are of the form
`projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.bigtable.admin.v2.Table,com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata> createTableFromSnapshotAsync(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
SnapshotName sourceSnapshot = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
CreateTableFromSnapshotRequest request = CreateTableFromSnapshotRequest.newBuilder()
.setParent(parent.toString())
.setTableId(tableId)
.setSourceSnapshot(sourceSnapshot.toString())
.build();
Table response = baseBigtableTableAdminClient.createTableFromSnapshotAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest,com.google.bigtable.admin.v2.Table,com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata> createTableFromSnapshotOperationCallable()
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
SnapshotName sourceSnapshot = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
CreateTableFromSnapshotRequest request = CreateTableFromSnapshotRequest.newBuilder()
.setParent(parent.toString())
.setTableId(tableId)
.setSourceSnapshot(sourceSnapshot.toString())
.build();
OperationFuture<Table, CreateTableFromSnapshotMetadata> future = baseBigtableTableAdminClient.createTableFromSnapshotOperationCallable().futureCall(request);
// Do something
Table response = future.get();
}
public final UnaryCallable<com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest,Operation> createTableFromSnapshotCallable()
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
String tableId = "";
SnapshotName sourceSnapshot = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
CreateTableFromSnapshotRequest request = CreateTableFromSnapshotRequest.newBuilder()
.setParent(parent.toString())
.setTableId(tableId)
.setSourceSnapshot(sourceSnapshot.toString())
.build();
ApiFuture<Operation> future = baseBigtableTableAdminClient.createTableFromSnapshotCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final BaseBigtableTableAdminClient.ListTablesPagedResponse listTables(com.google.bigtable.admin.v2.InstanceName parent)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
for (Table element : baseBigtableTableAdminClient.listTables(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The unique name of the instance for which tables should be listed. Values are of
the form `projects/<project>/instances/<instance>`.ApiException
- if the remote call failspublic final BaseBigtableTableAdminClient.ListTablesPagedResponse listTables(String parent)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
for (Table element : baseBigtableTableAdminClient.listTables(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The unique name of the instance for which tables should be listed. Values are of
the form `projects/<project>/instances/<instance>`.ApiException
- if the remote call failspublic final BaseBigtableTableAdminClient.ListTablesPagedResponse listTables(com.google.bigtable.admin.v2.ListTablesRequest request)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
ListTablesRequest request = ListTablesRequest.newBuilder()
.setParent(parent.toString())
.build();
for (Table element : baseBigtableTableAdminClient.listTables(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.ListTablesRequest,BaseBigtableTableAdminClient.ListTablesPagedResponse> listTablesPagedCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
ListTablesRequest request = ListTablesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListTablesPagedResponse> future = baseBigtableTableAdminClient.listTablesPagedCallable().futureCall(request);
// Do something
for (Table element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.bigtable.admin.v2.ListTablesRequest,com.google.bigtable.admin.v2.ListTablesResponse> listTablesCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
ListTablesRequest request = ListTablesRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListTablesResponse response = baseBigtableTableAdminClient.listTablesCallable().call(request);
for (Table element : response.getTablesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.bigtable.admin.v2.Table getTable(com.google.bigtable.admin.v2.TableName name)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
Table response = baseBigtableTableAdminClient.getTable(name);
}
name
- The unique name of the requested table. Values are of the form
`projects/<project>/instances/<instance>/tables/<table>`.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.Table getTable(String name)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
Table response = baseBigtableTableAdminClient.getTable(name.toString());
}
name
- The unique name of the requested table. Values are of the form
`projects/<project>/instances/<instance>/tables/<table>`.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.Table getTable(com.google.bigtable.admin.v2.GetTableRequest request)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
GetTableRequest request = GetTableRequest.newBuilder()
.setName(name.toString())
.build();
Table response = baseBigtableTableAdminClient.getTable(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.GetTableRequest,com.google.bigtable.admin.v2.Table> getTableCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
GetTableRequest request = GetTableRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Table> future = baseBigtableTableAdminClient.getTableCallable().futureCall(request);
// Do something
Table response = future.get();
}
public final void deleteTable(com.google.bigtable.admin.v2.TableName name)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
baseBigtableTableAdminClient.deleteTable(name);
}
name
- The unique name of the table to be deleted. Values are of the form
`projects/<project>/instances/<instance>/tables/<table>`.ApiException
- if the remote call failspublic final void deleteTable(String name)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
baseBigtableTableAdminClient.deleteTable(name.toString());
}
name
- The unique name of the table to be deleted. Values are of the form
`projects/<project>/instances/<instance>/tables/<table>`.ApiException
- if the remote call failspublic final void deleteTable(com.google.bigtable.admin.v2.DeleteTableRequest request)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
DeleteTableRequest request = DeleteTableRequest.newBuilder()
.setName(name.toString())
.build();
baseBigtableTableAdminClient.deleteTable(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.DeleteTableRequest,Empty> deleteTableCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
DeleteTableRequest request = DeleteTableRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = baseBigtableTableAdminClient.deleteTableCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.bigtable.admin.v2.Table modifyColumnFamilies(com.google.bigtable.admin.v2.TableName name, List<com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification> modifications)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
Table response = baseBigtableTableAdminClient.modifyColumnFamilies(name, modifications);
}
name
- The unique name of the table whose families should be modified. Values are of the
form `projects/<project>/instances/<instance>/tables/<table>`.modifications
- Modifications to be atomically applied to the specified table's families.
Entries are applied in order, meaning that earlier modifications can be masked by later
ones (in the case of repeated updates to the same family, for example).ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.Table modifyColumnFamilies(String name, List<com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification> modifications)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
Table response = baseBigtableTableAdminClient.modifyColumnFamilies(name.toString(), modifications);
}
name
- The unique name of the table whose families should be modified. Values are of the
form `projects/<project>/instances/<instance>/tables/<table>`.modifications
- Modifications to be atomically applied to the specified table's families.
Entries are applied in order, meaning that earlier modifications can be masked by later
ones (in the case of repeated updates to the same family, for example).ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.Table modifyColumnFamilies(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
ModifyColumnFamiliesRequest request = ModifyColumnFamiliesRequest.newBuilder()
.setName(name.toString())
.addAllModifications(modifications)
.build();
Table response = baseBigtableTableAdminClient.modifyColumnFamilies(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest,com.google.bigtable.admin.v2.Table> modifyColumnFamiliesCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
ModifyColumnFamiliesRequest request = ModifyColumnFamiliesRequest.newBuilder()
.setName(name.toString())
.addAllModifications(modifications)
.build();
ApiFuture<Table> future = baseBigtableTableAdminClient.modifyColumnFamiliesCallable().futureCall(request);
// Do something
Table response = future.get();
}
public final void dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest request)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
DropRowRangeRequest request = DropRowRangeRequest.newBuilder()
.setName(name.toString())
.build();
baseBigtableTableAdminClient.dropRowRange(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.DropRowRangeRequest,Empty> dropRowRangeCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
DropRowRangeRequest request = DropRowRangeRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = baseBigtableTableAdminClient.dropRowRangeCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse generateConsistencyToken(com.google.bigtable.admin.v2.TableName name)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
GenerateConsistencyTokenResponse response = baseBigtableTableAdminClient.generateConsistencyToken(name);
}
name
- The unique name of the Table for which to create a consistency token. Values are of
the form `projects/<project>/instances/<instance>/tables/<table>`.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse generateConsistencyToken(String name)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
GenerateConsistencyTokenResponse response = baseBigtableTableAdminClient.generateConsistencyToken(name.toString());
}
name
- The unique name of the Table for which to create a consistency token. Values are of
the form `projects/<project>/instances/<instance>/tables/<table>`.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse generateConsistencyToken(com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
GenerateConsistencyTokenRequest request = GenerateConsistencyTokenRequest.newBuilder()
.setName(name.toString())
.build();
GenerateConsistencyTokenResponse response = baseBigtableTableAdminClient.generateConsistencyToken(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest,com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse> generateConsistencyTokenCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
GenerateConsistencyTokenRequest request = GenerateConsistencyTokenRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<GenerateConsistencyTokenResponse> future = baseBigtableTableAdminClient.generateConsistencyTokenCallable().futureCall(request);
// Do something
GenerateConsistencyTokenResponse response = future.get();
}
public final com.google.bigtable.admin.v2.CheckConsistencyResponse checkConsistency(com.google.bigtable.admin.v2.TableName name, String consistencyToken)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
String consistencyToken = "";
CheckConsistencyResponse response = baseBigtableTableAdminClient.checkConsistency(name, consistencyToken);
}
name
- The unique name of the Table for which to check replication consistency. Values are
of the form `projects/<project>/instances/<instance>/tables/<table>`.consistencyToken
- The token created using GenerateConsistencyToken for the Table.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.CheckConsistencyResponse checkConsistency(String name, String consistencyToken)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
String consistencyToken = "";
CheckConsistencyResponse response = baseBigtableTableAdminClient.checkConsistency(name.toString(), consistencyToken);
}
name
- The unique name of the Table for which to check replication consistency. Values are
of the form `projects/<project>/instances/<instance>/tables/<table>`.consistencyToken
- The token created using GenerateConsistencyToken for the Table.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.CheckConsistencyResponse checkConsistency(com.google.bigtable.admin.v2.CheckConsistencyRequest request)
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
String consistencyToken = "";
CheckConsistencyRequest request = CheckConsistencyRequest.newBuilder()
.setName(name.toString())
.setConsistencyToken(consistencyToken)
.build();
CheckConsistencyResponse response = baseBigtableTableAdminClient.checkConsistency(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.CheckConsistencyRequest,com.google.bigtable.admin.v2.CheckConsistencyResponse> checkConsistencyCallable()
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
String consistencyToken = "";
CheckConsistencyRequest request = CheckConsistencyRequest.newBuilder()
.setName(name.toString())
.setConsistencyToken(consistencyToken)
.build();
ApiFuture<CheckConsistencyResponse> future = baseBigtableTableAdminClient.checkConsistencyCallable().futureCall(request);
// Do something
CheckConsistencyResponse response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.bigtable.admin.v2.Snapshot,com.google.bigtable.admin.v2.SnapshotTableMetadata> snapshotTableAsync(com.google.bigtable.admin.v2.TableName name, com.google.bigtable.admin.v2.ClusterName cluster, com.google.bigtable.admin.v2.SnapshotName snapshotId, String description)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
SnapshotName snapshotId = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
String description = "";
Snapshot response = baseBigtableTableAdminClient.snapshotTableAsync(name, cluster, snapshotId, description).get();
}
name
- The unique name of the table to have the snapshot taken. Values are of the form
`projects/<project>/instances/<instance>/tables/<table>`.cluster
- The name of the cluster where the snapshot will be created in. Values are of the
form `projects/<project>/instances/<instance>/clusters/<cluster>`.snapshotId
- The ID by which the new snapshot should be referred to within the parent
cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
`projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/mysnapshot`.description
- Description of the snapshot.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.bigtable.admin.v2.Snapshot,com.google.bigtable.admin.v2.SnapshotTableMetadata> snapshotTableAsync(String name, String cluster, String snapshotId, String description)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
SnapshotName snapshotId = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
String description = "";
Snapshot response = baseBigtableTableAdminClient.snapshotTableAsync(name.toString(), cluster.toString(), snapshotId.toString(), description).get();
}
name
- The unique name of the table to have the snapshot taken. Values are of the form
`projects/<project>/instances/<instance>/tables/<table>`.cluster
- The name of the cluster where the snapshot will be created in. Values are of the
form `projects/<project>/instances/<instance>/clusters/<cluster>`.snapshotId
- The ID by which the new snapshot should be referred to within the parent
cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
`projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/mysnapshot`.description
- Description of the snapshot.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.bigtable.admin.v2.Snapshot,com.google.bigtable.admin.v2.SnapshotTableMetadata> snapshotTableAsync(com.google.bigtable.admin.v2.SnapshotTableRequest request)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
SnapshotName snapshotId = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
String description = "";
SnapshotTableRequest request = SnapshotTableRequest.newBuilder()
.setName(name.toString())
.setCluster(cluster.toString())
.setSnapshotId(snapshotId.toString())
.setDescription(description)
.build();
Snapshot response = baseBigtableTableAdminClient.snapshotTableAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.bigtable.admin.v2.SnapshotTableRequest,com.google.bigtable.admin.v2.Snapshot,com.google.bigtable.admin.v2.SnapshotTableMetadata> snapshotTableOperationCallable()
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
SnapshotName snapshotId = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
String description = "";
SnapshotTableRequest request = SnapshotTableRequest.newBuilder()
.setName(name.toString())
.setCluster(cluster.toString())
.setSnapshotId(snapshotId.toString())
.setDescription(description)
.build();
OperationFuture<Snapshot, SnapshotTableMetadata> future = baseBigtableTableAdminClient.snapshotTableOperationCallable().futureCall(request);
// Do something
Snapshot response = future.get();
}
public final UnaryCallable<com.google.bigtable.admin.v2.SnapshotTableRequest,Operation> snapshotTableCallable()
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
SnapshotName snapshotId = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
String description = "";
SnapshotTableRequest request = SnapshotTableRequest.newBuilder()
.setName(name.toString())
.setCluster(cluster.toString())
.setSnapshotId(snapshotId.toString())
.setDescription(description)
.build();
ApiFuture<Operation> future = baseBigtableTableAdminClient.snapshotTableCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.bigtable.admin.v2.Snapshot getSnapshot(com.google.bigtable.admin.v2.SnapshotName name)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
Snapshot response = baseBigtableTableAdminClient.getSnapshot(name);
}
name
- The unique name of the requested snapshot. Values are of the form
`projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.Snapshot getSnapshot(String name)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
Snapshot response = baseBigtableTableAdminClient.getSnapshot(name.toString());
}
name
- The unique name of the requested snapshot. Values are of the form
`projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.ApiException
- if the remote call failspublic final com.google.bigtable.admin.v2.Snapshot getSnapshot(com.google.bigtable.admin.v2.GetSnapshotRequest request)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
GetSnapshotRequest request = GetSnapshotRequest.newBuilder()
.setName(name.toString())
.build();
Snapshot response = baseBigtableTableAdminClient.getSnapshot(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.GetSnapshotRequest,com.google.bigtable.admin.v2.Snapshot> getSnapshotCallable()
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
GetSnapshotRequest request = GetSnapshotRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Snapshot> future = baseBigtableTableAdminClient.getSnapshotCallable().futureCall(request);
// Do something
Snapshot response = future.get();
}
public final BaseBigtableTableAdminClient.ListSnapshotsPagedResponse listSnapshots(com.google.bigtable.admin.v2.ClusterName parent)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
for (Snapshot element : baseBigtableTableAdminClient.listSnapshots(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The unique name of the cluster for which snapshots should be listed. Values are
of the form `projects/<project>/instances/<instance>/clusters/<cluster>`.
Use `<cluster> = '-'` to list snapshots for all clusters in an instance, e.g.,
`projects/<project>/instances/<instance>/clusters/-`.ApiException
- if the remote call failspublic final BaseBigtableTableAdminClient.ListSnapshotsPagedResponse listSnapshots(String parent)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
for (Snapshot element : baseBigtableTableAdminClient.listSnapshots(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The unique name of the cluster for which snapshots should be listed. Values are
of the form `projects/<project>/instances/<instance>/clusters/<cluster>`.
Use `<cluster> = '-'` to list snapshots for all clusters in an instance, e.g.,
`projects/<project>/instances/<instance>/clusters/-`.ApiException
- if the remote call failspublic final BaseBigtableTableAdminClient.ListSnapshotsPagedResponse listSnapshots(com.google.bigtable.admin.v2.ListSnapshotsRequest request)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (Snapshot element : baseBigtableTableAdminClient.listSnapshots(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.ListSnapshotsRequest,BaseBigtableTableAdminClient.ListSnapshotsPagedResponse> listSnapshotsPagedCallable()
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListSnapshotsPagedResponse> future = baseBigtableTableAdminClient.listSnapshotsPagedCallable().futureCall(request);
// Do something
for (Snapshot element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.bigtable.admin.v2.ListSnapshotsRequest,com.google.bigtable.admin.v2.ListSnapshotsResponse> listSnapshotsCallable()
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListSnapshotsResponse response = baseBigtableTableAdminClient.listSnapshotsCallable().call(request);
for (Snapshot element : response.getSnapshotsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteSnapshot(com.google.bigtable.admin.v2.SnapshotName name)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
baseBigtableTableAdminClient.deleteSnapshot(name);
}
name
- The unique name of the snapshot to be deleted. Values are of the form
`projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.ApiException
- if the remote call failspublic final void deleteSnapshot(String name)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
baseBigtableTableAdminClient.deleteSnapshot(name.toString());
}
name
- The unique name of the snapshot to be deleted. Values are of the form
`projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.ApiException
- if the remote call failspublic final void deleteSnapshot(com.google.bigtable.admin.v2.DeleteSnapshotRequest request)
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder()
.setName(name.toString())
.build();
baseBigtableTableAdminClient.deleteSnapshot(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.bigtable.admin.v2.DeleteSnapshotRequest,Empty> deleteSnapshotCallable()
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Sample code:
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = baseBigtableTableAdminClient.deleteSnapshotCallable().futureCall(request);
// Do something
future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.