com.google.cloud.bigtable.grpc
Class BigtableTableAdminGCJClient
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.BigtableTableAdminGCJClient
-
- All Implemented Interfaces:
- IBigtableTableAdminClient, AutoCloseable
public class BigtableTableAdminGCJClient extends Object implements IBigtableTableAdminClient, AutoCloseable
This class implements existingIBigtableTableAdminClient
operations with Google-cloud-java'sBigtableTableAdminClient
&BaseBigtableTableAdminClient
.
-
-
Constructor Summary
Constructors Constructor and Description BigtableTableAdminGCJClient(com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient delegate, com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient baseAdminClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
close()
com.google.cloud.bigtable.admin.v2.models.Table
createTable(com.google.cloud.bigtable.admin.v2.models.CreateTableRequest request)
Creates a new table.com.google.api.core.ApiFuture<com.google.cloud.bigtable.admin.v2.models.Table>
createTableAsync(com.google.cloud.bigtable.admin.v2.models.CreateTableRequest request)
Creates a new table asynchronously.com.google.api.core.ApiFuture<com.google.longrunning.Operation>
createTableFromSnapshotAsync(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request)
Creates a new table from a snapshot.com.google.api.core.ApiFuture<Void>
deleteSnapshotAsync(com.google.bigtable.admin.v2.DeleteSnapshotRequest request)
Permanently deletes the specified snapshot.void
deleteTable(String tableId)
Permanently deletes a specified table and all of its data.com.google.api.core.ApiFuture<Void>
deleteTableAsync(String tableId)
Permanently deletes a specified table and all of its data.void
dropAllRows(String tableId)
Drops all data in the table.com.google.api.core.ApiFuture<Void>
dropAllRowsAsync(String tableId)
Asynchronously drops all data in the tablevoid
dropRowRange(String tableId, String rowKeyPrefix)
Permanently deletes all rows in a range.com.google.api.core.ApiFuture<Void>
dropRowRangeAsync(String tableId, String rowKeyPrefix)
Permanently deletes all rows in a range.com.google.api.core.ApiFuture<com.google.bigtable.admin.v2.Snapshot>
getSnapshotAsync(com.google.bigtable.admin.v2.GetSnapshotRequest request)
Gets metadata information about the specified snapshot.com.google.cloud.bigtable.admin.v2.models.Table
getTable(String tableId)
Gets the details of a table.com.google.api.core.ApiFuture<com.google.cloud.bigtable.admin.v2.models.Table>
getTableAsync(String tableId)
Gets the details of a table asynchronously.com.google.api.core.ApiFuture<com.google.bigtable.admin.v2.ListSnapshotsResponse>
listSnapshotsAsync(com.google.bigtable.admin.v2.ListSnapshotsRequest request)
Lists all snapshots associated with the specified cluster.List<String>
listTables()
Lists the names of all tables in an instance.com.google.api.core.ApiFuture<List<String>>
listTablesAsync()
Lists the names of all tables in an instance asynchronously.com.google.cloud.bigtable.admin.v2.models.Table
modifyFamilies(com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest request)
Creates, modifies or deletes a new column family within a specified table.com.google.api.core.ApiFuture<com.google.cloud.bigtable.admin.v2.models.Table>
modifyFamiliesAsync(com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest request)
Creates, modifies or deletes a new column family within a specified table.com.google.api.core.ApiFuture<com.google.longrunning.Operation>
snapshotTableAsync(com.google.bigtable.admin.v2.SnapshotTableRequest request)
Creates a new snapshot from a table in a specific cluster.
-
-
-
Constructor Detail
-
BigtableTableAdminGCJClient
public BigtableTableAdminGCJClient(@Nonnull com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient delegate, @Nonnull com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient baseAdminClient)
-
-
Method Detail
-
createTable
public com.google.cloud.bigtable.admin.v2.models.Table createTable(com.google.cloud.bigtable.admin.v2.models.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 interfaceIBigtableTableAdminClient
- Parameters:
request
- aCreateTableRequest
object.
-
createTableAsync
public com.google.api.core.ApiFuture<com.google.cloud.bigtable.admin.v2.models.Table> createTableAsync(com.google.cloud.bigtable.admin.v2.models.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 interfaceIBigtableTableAdminClient
- Parameters:
request
- aCreateTableRequest
object.
-
getTable
public com.google.cloud.bigtable.admin.v2.models.Table getTable(String tableId)
Gets the details of a table.- Specified by:
getTable
in interfaceIBigtableTableAdminClient
- Parameters:
tableId
- a String object.- Returns:
- a
Table
object.
-
getTableAsync
public com.google.api.core.ApiFuture<com.google.cloud.bigtable.admin.v2.models.Table> getTableAsync(String tableId)
Gets the details of a table asynchronously.- Specified by:
getTableAsync
in interfaceIBigtableTableAdminClient
- Returns:
- a
ApiFuture
that returns aTable
object.
-
listTables
public List<String> listTables()
Lists the names of all tables in an instance.- Specified by:
listTables
in interfaceIBigtableTableAdminClient
- Returns:
- an immutable
List
object containing tableId.
-
listTablesAsync
public com.google.api.core.ApiFuture<List<String>> listTablesAsync()
Lists the names of all tables in an instance asynchronously.- Specified by:
listTablesAsync
in interfaceIBigtableTableAdminClient
- Returns:
- a
ApiFuture
of typeVoid
will be set when request is successful otherwise exception will be thrown.
-
deleteTable
public void deleteTable(String tableId)
Permanently deletes a specified table and all of its data.- Specified by:
deleteTable
in interfaceIBigtableTableAdminClient
-
deleteTableAsync
public com.google.api.core.ApiFuture<Void> deleteTableAsync(String tableId)
Permanently deletes a specified table and all of its data.- Specified by:
deleteTableAsync
in interfaceIBigtableTableAdminClient
- Returns:
- a
ApiFuture
of typeVoid
will be set when request is successful otherwise exception will be thrown.
-
modifyFamilies
public com.google.cloud.bigtable.admin.v2.models.Table modifyFamilies(com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest request)
Creates, modifies or deletes a new column family within a specified table.- Specified by:
modifyFamilies
in interfaceIBigtableTableAdminClient
- Parameters:
request
- aModifyColumnFamiliesRequest
object.- Returns:
- return
Table
object that contains the updated table structure.
-
modifyFamiliesAsync
public com.google.api.core.ApiFuture<com.google.cloud.bigtable.admin.v2.models.Table> modifyFamiliesAsync(com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest request)
Creates, modifies or deletes a new column family within a specified table.- Specified by:
modifyFamiliesAsync
in interfaceIBigtableTableAdminClient
- Parameters:
request
- aModifyColumnFamiliesRequest
object.- Returns:
- a
ApiFuture
that returnsTable
object that contains the updated table structure.
-
dropRowRange
public void dropRowRange(String tableId, String rowKeyPrefix)
Permanently deletes all rows in a range.- Specified by:
dropRowRange
in interfaceIBigtableTableAdminClient
-
dropRowRangeAsync
public com.google.api.core.ApiFuture<Void> dropRowRangeAsync(String tableId, String rowKeyPrefix)
Permanently deletes all rows in a range.- Specified by:
dropRowRangeAsync
in interfaceIBigtableTableAdminClient
- Returns:
- a
ApiFuture
that returnsVoid
object.
-
dropAllRows
public void dropAllRows(String tableId)
Drops all data in the table.- Specified by:
dropAllRows
in interfaceIBigtableTableAdminClient
- Parameters:
tableId
- aString
object.
-
dropAllRowsAsync
public com.google.api.core.ApiFuture<Void> dropAllRowsAsync(String tableId)
Asynchronously drops all data in the table- Specified by:
dropAllRowsAsync
in interfaceIBigtableTableAdminClient
- Parameters:
tableId
- aString
object.
-
snapshotTableAsync
public com.google.api.core.ApiFuture<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 interfaceIBigtableTableAdminClient
- Parameters:
request
- aSnapshotTableRequest
object.- Returns:
- The long running
Operation
for the request.
-
getSnapshotAsync
public com.google.api.core.ApiFuture<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 interfaceIBigtableTableAdminClient
- Parameters:
request
- aGetSnapshotRequest
object.- Returns:
- The
Snapshot
defined by the request.
-
listSnapshotsAsync
public com.google.api.core.ApiFuture<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 interfaceIBigtableTableAdminClient
- Parameters:
request
- aListSnapshotsRequest
object.- Returns:
- The
ListSnapshotsResponse
which has the list of the snapshots in the cluster.
-
deleteSnapshotAsync
public com.google.api.core.ApiFuture<Void> deleteSnapshotAsync(com.google.bigtable.admin.v2.DeleteSnapshotRequest request)
Permanently deletes the specified snapshot.- Specified by:
deleteSnapshotAsync
in interfaceIBigtableTableAdminClient
- Parameters:
request
- aDeleteSnapshotRequest
object.
-
createTableFromSnapshotAsync
public com.google.api.core.ApiFuture<com.google.longrunning.Operation> createTableFromSnapshotAsync(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request)
Creates a new table from a snapshot.- Specified by:
createTableFromSnapshotAsync
in interfaceIBigtableTableAdminClient
- Parameters:
request
- aCreateTableFromSnapshotRequest
object.- Returns:
- The long running
Operation
for the request.
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-