com.google.cloud.bigtable.grpc
Class BigtableTableAdminGrpcClient
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.BigtableTableAdminGrpcClient
-
- All Implemented Interfaces:
- BigtableTableAdminClient
public class BigtableTableAdminGrpcClient extends Object implements BigtableTableAdminClient
A gRPC client for accessing the Bigtable Table Admin API.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Constructor Summary
Constructors Constructor and Description BigtableTableAdminGrpcClient(io.grpc.Channel channel, ScheduledExecutorService retryExecutorService, BigtableOptions bigtableOptions)
Constructor for BigtableTableAdminGrpcClient.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description com.google.bigtable.admin.v2.Table
createTable(com.google.bigtable.admin.v2.CreateTableRequest request)
Creates a new table.ListenableFuture<com.google.bigtable.admin.v2.Table>
createTableAsync(com.google.bigtable.admin.v2.CreateTableRequest request)
Creates a new table asynchronously.ListenableFuture<com.google.longrunning.Operation>
createTableFromSnapshotAsync(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request)
Creates a new table from a snapshot.ListenableFuture<Empty>
deleteSnapshotAsync(com.google.bigtable.admin.v2.DeleteSnapshotRequest request)
Permanently deletes the specified snapshot.void
deleteTable(com.google.bigtable.admin.v2.DeleteTableRequest request)
Permanently deletes a specified table and all of its data.ListenableFuture<Empty>
deleteTableAsync(com.google.bigtable.admin.v2.DeleteTableRequest request)
Permanently deletes a specified table and all of its data.void
dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest request)
Permanently deletes all rows in a range.ListenableFuture<Empty>
dropRowRangeAsync(com.google.bigtable.admin.v2.DropRowRangeRequest request)
Permanently deletes all rows in a range.ListenableFuture<com.google.bigtable.admin.v2.Snapshot>
getSnapshotAsync(com.google.bigtable.admin.v2.GetSnapshotRequest request)
Gets metadata information about the specified snapshot.com.google.bigtable.admin.v2.Table
getTable(com.google.bigtable.admin.v2.GetTableRequest request)
Gets the details of a table.ListenableFuture<com.google.bigtable.admin.v2.Table>
getTableAsync(com.google.bigtable.admin.v2.GetTableRequest request)
Gets the details of a table asynchronously.ListenableFuture<com.google.bigtable.admin.v2.ListSnapshotsResponse>
listSnapshotsAsync(com.google.bigtable.admin.v2.ListSnapshotsRequest request)
Lists all snapshots associated with the specified cluster.com.google.bigtable.admin.v2.ListTablesResponse
listTables(com.google.bigtable.admin.v2.ListTablesRequest request)
Lists the names of all tables in an instance.ListenableFuture<com.google.bigtable.admin.v2.ListTablesResponse>
listTablesAsync(com.google.bigtable.admin.v2.ListTablesRequest request)
Lists the names of all tables in an instance asynchronously.com.google.bigtable.admin.v2.Table
modifyColumnFamily(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request)
Creates, modifies or deletes a new column family within a specified table.ListenableFuture<com.google.bigtable.admin.v2.Table>
modifyColumnFamilyAsync(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request)
Creates, modifies or deletes a new column family within a specified table.ListenableFuture<com.google.longrunning.Operation>
snapshotTableAsync(com.google.bigtable.admin.v2.SnapshotTableRequest request)
Creates a new snapshot from a table in a specific cluster.void
waitForReplication(BigtableTableName tableName, long timeout)
Blocks until replication has caught up to the point this method was called or timeout is reached.
-
-
-
Constructor Detail
-
BigtableTableAdminGrpcClient
public BigtableTableAdminGrpcClient(io.grpc.Channel channel, ScheduledExecutorService retryExecutorService, BigtableOptions bigtableOptions)
Constructor for BigtableTableAdminGrpcClient.- Parameters:
channel
- aChannel
object.
-
-
Method Detail
-
listTables
public com.google.bigtable.admin.v2.ListTablesResponse listTables(com.google.bigtable.admin.v2.ListTablesRequest request)
Lists the names of all tables in an instance.- Specified by:
listTables
in interfaceBigtableTableAdminClient
- Parameters:
request
- aListTablesRequest
object.- Returns:
- a
ListTablesResponse
object.
-
listTablesAsync
public ListenableFuture<com.google.bigtable.admin.v2.ListTablesResponse> listTablesAsync(com.google.bigtable.admin.v2.ListTablesRequest request)
Lists the names of all tables in an instance asynchronously.- Specified by:
listTablesAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aListTablesRequest
object.- Returns:
- a
ListenableFuture
that returns aListTablesResponse
object.
-
getTable
public com.google.bigtable.admin.v2.Table getTable(com.google.bigtable.admin.v2.GetTableRequest request)
Gets the details of a table.- Specified by:
getTable
in interfaceBigtableTableAdminClient
- Parameters:
request
- aGetTableRequest
object.- Returns:
- a
Table
object.
-
getTableAsync
public ListenableFuture<com.google.bigtable.admin.v2.Table> getTableAsync(com.google.bigtable.admin.v2.GetTableRequest request)
Gets the details of a table asynchronously.- Specified by:
getTableAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aGetTableRequest
object.- Returns:
- a
ListenableFuture
that returns aTable
object.
-
createTable
public com.google.bigtable.admin.v2.Table createTable(com.google.bigtable.admin.v2.CreateTableRequest request)
Creates a new table. The table can be created with a full set of initial column families, specified in the request.- Specified by:
createTable
in interfaceBigtableTableAdminClient
- Parameters:
request
- aCreateTableRequest
object.
-
createTableAsync
public ListenableFuture<com.google.bigtable.admin.v2.Table> createTableAsync(com.google.bigtable.admin.v2.CreateTableRequest request)
Creates a new table asynchronously. The table can be created with a full set of initial column families, specified in the request.- Specified by:
createTableAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aCreateTableRequest
object.- Returns:
-
modifyColumnFamily
public com.google.bigtable.admin.v2.Table modifyColumnFamily(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request)
Creates, modifies or deletes a new column family within a specified table.- Specified by:
modifyColumnFamily
in interfaceBigtableTableAdminClient
- Parameters:
request
- aModifyColumnFamiliesRequest
object.- Returns:
- return
Table
object that contains the updated table structure.
-
modifyColumnFamilyAsync
public ListenableFuture<com.google.bigtable.admin.v2.Table> modifyColumnFamilyAsync(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request)
Creates, modifies or deletes a new column family within a specified table.- Specified by:
modifyColumnFamilyAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aModifyColumnFamiliesRequest
object.- Returns:
-
deleteTable
public void deleteTable(com.google.bigtable.admin.v2.DeleteTableRequest request)
Permanently deletes a specified table and all of its data.- Specified by:
deleteTable
in interfaceBigtableTableAdminClient
- Parameters:
request
- aDeleteTableRequest
object.
-
deleteTableAsync
public ListenableFuture<Empty> deleteTableAsync(com.google.bigtable.admin.v2.DeleteTableRequest request)
Permanently deletes a specified table and all of its data.- Specified by:
deleteTableAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aDeleteTableRequest
object.- Returns:
-
dropRowRange
public void dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest request)
Permanently deletes all rows in a range.- Specified by:
dropRowRange
in interfaceBigtableTableAdminClient
- Parameters:
request
- aDropRowRangeRequest
object.
-
dropRowRangeAsync
public ListenableFuture<Empty> dropRowRangeAsync(com.google.bigtable.admin.v2.DropRowRangeRequest request)
Permanently deletes all rows in a range.- Specified by:
dropRowRangeAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aDropRowRangeRequest
object.- Returns:
-
waitForReplication
public void waitForReplication(BigtableTableName tableName, long timeout) throws InterruptedException, TimeoutException
Blocks until replication has caught up to the point this method was called or timeout is reached.- Specified by:
waitForReplication
in interfaceBigtableTableAdminClient
- Parameters:
tableName
- the name of the table to wait for replication.timeout
- the maximum time to wait in seconds.- Throws:
InterruptedException
- if call is interrupted while waiting to recheck if replication has caught up.TimeoutException
- if timeout is reached.
-
snapshotTableAsync
public ListenableFuture<com.google.longrunning.Operation> snapshotTableAsync(com.google.bigtable.admin.v2.SnapshotTableRequest request)
Creates a new snapshot from a table in a specific cluster.- Specified by:
snapshotTableAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aSnapshotTableRequest
object.- Returns:
- The long running
Operation
for the request.
-
getSnapshotAsync
public ListenableFuture<com.google.bigtable.admin.v2.Snapshot> getSnapshotAsync(com.google.bigtable.admin.v2.GetSnapshotRequest request)
Gets metadata information about the specified snapshot.- Specified by:
getSnapshotAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aGetSnapshotRequest
object.- Returns:
- The
Snapshot
defined by the request.
-
listSnapshotsAsync
public ListenableFuture<com.google.bigtable.admin.v2.ListSnapshotsResponse> listSnapshotsAsync(com.google.bigtable.admin.v2.ListSnapshotsRequest request)
Lists all snapshots associated with the specified cluster.- Specified by:
listSnapshotsAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aListSnapshotsRequest
object.- Returns:
- The
ListSnapshotsResponse
which has the list of the snapshots in the cluster.
-
deleteSnapshotAsync
public ListenableFuture<Empty> deleteSnapshotAsync(com.google.bigtable.admin.v2.DeleteSnapshotRequest request)
Permanently deletes the specified snapshot.- Specified by:
deleteSnapshotAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aDeleteSnapshotRequest
object.
-
createTableFromSnapshotAsync
public ListenableFuture<com.google.longrunning.Operation> createTableFromSnapshotAsync(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request)
Creates a new table from a snapshot.- Specified by:
createTableFromSnapshotAsync
in interfaceBigtableTableAdminClient
- Parameters:
request
- aCreateTableFromSnapshotRequest
object.- Returns:
- The long running
Operation
for the request.
-
-