diff --git a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java similarity index 79% rename from google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java rename to google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java index 5a67f6769b68..b0b9caefbc2a 100644 --- a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java +++ b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java @@ -84,14 +84,14 @@ * *
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * Instance response = bigtableInstanceAdminClient.getInstance(name);
+ * Instance response = baseBigtableInstanceAdminClient.getInstance(name);
* }
*
*
*
- * Note: close() needs to be called on the bigtableInstanceAdminClient object to clean up + *
Note: close() needs to be called on the baseBigtableInstanceAdminClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). * @@ -115,19 +115,19 @@ * 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 BigtableInstanceAdminSettings - * to create(). For example: + *
This class can be customized by passing in a custom instance of + * BaseBigtableInstanceAdminSettings to create(). For example: * *
To customize credentials: * *
*
- * BigtableInstanceAdminSettings bigtableInstanceAdminSettings =
- * BigtableInstanceAdminSettings.newBuilder()
+ * BaseBigtableInstanceAdminSettings baseBigtableInstanceAdminSettings =
+ * BaseBigtableInstanceAdminSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * BigtableInstanceAdminClient bigtableInstanceAdminClient =
- * BigtableInstanceAdminClient.create(bigtableInstanceAdminSettings);
+ * BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create(baseBigtableInstanceAdminSettings);
*
*
*
@@ -135,62 +135,64 @@
*
*
*
- * BigtableInstanceAdminSettings bigtableInstanceAdminSettings =
- * BigtableInstanceAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
- * BigtableInstanceAdminClient bigtableInstanceAdminClient =
- * BigtableInstanceAdminClient.create(bigtableInstanceAdminSettings);
+ * BaseBigtableInstanceAdminSettings baseBigtableInstanceAdminSettings =
+ * BaseBigtableInstanceAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create(baseBigtableInstanceAdminSettings);
*
*
*/
@Generated("by gapic-generator")
@BetaApi
-public class BigtableInstanceAdminClient implements BackgroundResource {
- private final BigtableInstanceAdminSettings settings;
+public class BaseBigtableInstanceAdminClient implements BackgroundResource {
+ private final BaseBigtableInstanceAdminSettings settings;
private final BigtableInstanceAdminStub stub;
private final OperationsClient operationsClient;
- /** Constructs an instance of BigtableInstanceAdminClient with default settings. */
- public static final BigtableInstanceAdminClient create() throws IOException {
- return create(BigtableInstanceAdminSettings.newBuilder().build());
+ /** Constructs an instance of BaseBigtableInstanceAdminClient with default settings. */
+ public static final BaseBigtableInstanceAdminClient create() throws IOException {
+ return create(BaseBigtableInstanceAdminSettings.newBuilder().build());
}
/**
- * Constructs an instance of BigtableInstanceAdminClient, using the given settings. The channels
- * are created based on the settings passed in, or defaults for any settings that are not set.
+ * Constructs an instance of BaseBigtableInstanceAdminClient, using the given settings. The
+ * channels are created based on the settings passed in, or defaults for any settings that are not
+ * set.
*/
- public static final BigtableInstanceAdminClient create(BigtableInstanceAdminSettings settings)
- throws IOException {
- return new BigtableInstanceAdminClient(settings);
+ public static final BaseBigtableInstanceAdminClient create(
+ BaseBigtableInstanceAdminSettings settings) throws IOException {
+ return new BaseBigtableInstanceAdminClient(settings);
}
/**
- * Constructs an instance of BigtableInstanceAdminClient, using the given stub for making calls.
- * This is for advanced usage - prefer to use BigtableInstanceAdminSettings}.
+ * Constructs an instance of BaseBigtableInstanceAdminClient, using the given stub for making
+ * calls. This is for advanced usage - prefer to use BaseBigtableInstanceAdminSettings}.
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final BigtableInstanceAdminClient create(BigtableInstanceAdminStub stub) {
- return new BigtableInstanceAdminClient(stub);
+ public static final BaseBigtableInstanceAdminClient create(BigtableInstanceAdminStub stub) {
+ return new BaseBigtableInstanceAdminClient(stub);
}
/**
- * Constructs an instance of BigtableInstanceAdminClient, using the given settings. This is
+ * Constructs an instance of BaseBigtableInstanceAdminClient, using the given settings. This is
* protected so that it is easy to make a subclass, but otherwise, the static factory methods
* should be preferred.
*/
- protected BigtableInstanceAdminClient(BigtableInstanceAdminSettings settings) throws IOException {
+ protected BaseBigtableInstanceAdminClient(BaseBigtableInstanceAdminSettings settings)
+ throws IOException {
this.settings = settings;
this.stub = ((BigtableInstanceAdminStubSettings) settings.getStubSettings()).createStub();
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected BigtableInstanceAdminClient(BigtableInstanceAdminStub stub) {
+ protected BaseBigtableInstanceAdminClient(BigtableInstanceAdminStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
- public final BigtableInstanceAdminSettings getSettings() {
+ public final BaseBigtableInstanceAdminSettings getSettings() {
return settings;
}
@@ -216,12 +218,12 @@ public final OperationsClient getOperationsClient() {
* Sample code: * *
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String instanceId = "";
* Instance instance = Instance.newBuilder().build();
* Map<String, Cluster> clusters = new HashMap<>();
- * Instance response = bigtableInstanceAdminClient.createInstanceAsync(parent, instanceId, instance, clusters).get();
+ * Instance response = baseBigtableInstanceAdminClient.createInstanceAsync(parent, instanceId, instance, clusters).get();
* }
*
*
@@ -258,12 +260,12 @@ public final OperationFutureSample code: * *
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String instanceId = "";
* Instance instance = Instance.newBuilder().build();
* Map<String, Cluster> clusters = new HashMap<>();
- * Instance response = bigtableInstanceAdminClient.createInstanceAsync(parent.toString(), instanceId, instance, clusters).get();
+ * Instance response = baseBigtableInstanceAdminClient.createInstanceAsync(parent.toString(), instanceId, instance, clusters).get();
* }
*
*
@@ -300,7 +302,7 @@ public final OperationFutureSample code: * *
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String instanceId = "";
* Instance instance = Instance.newBuilder().build();
@@ -311,7 +313,7 @@ public final OperationFuture createInstanceAsy
* .setInstance(instance)
* .putAllClusters(clusters)
* .build();
- * Instance response = bigtableInstanceAdminClient.createInstanceAsync(request).get();
+ * Instance response = baseBigtableInstanceAdminClient.createInstanceAsync(request).get();
* }
*
*
@@ -332,7 +334,7 @@ public final OperationFutureSample code: * *
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String instanceId = "";
* Instance instance = Instance.newBuilder().build();
@@ -343,7 +345,7 @@ public final OperationFuture createInstanceAsy
* .setInstance(instance)
* .putAllClusters(clusters)
* .build();
- * OperationFuture<Operation> future = bigtableInstanceAdminClient.createInstanceOperationCallable().futureCall(request);
+ * OperationFuture<Operation> future = baseBigtableInstanceAdminClient.createInstanceOperationCallable().futureCall(request);
* // Do something
* Instance response = future.get();
* }
@@ -362,7 +364,7 @@ public final OperationFuture createInstanceAsy
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String instanceId = "";
* Instance instance = Instance.newBuilder().build();
@@ -373,7 +375,7 @@ public final OperationFuture createInstanceAsy
* .setInstance(instance)
* .putAllClusters(clusters)
* .build();
- * ApiFuture<Operation> future = bigtableInstanceAdminClient.createInstanceCallable().futureCall(request);
+ * ApiFuture<Operation> future = baseBigtableInstanceAdminClient.createInstanceCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
@@ -390,9 +392,9 @@ public final UnaryCallable createInstanceCalla
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * Instance response = bigtableInstanceAdminClient.getInstance(name);
+ * Instance response = baseBigtableInstanceAdminClient.getInstance(name);
* }
*
*
@@ -414,9 +416,9 @@ public final Instance getInstance(InstanceName name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * Instance response = bigtableInstanceAdminClient.getInstance(name.toString());
+ * Instance response = baseBigtableInstanceAdminClient.getInstance(name.toString());
* }
*
*
@@ -437,12 +439,12 @@ public final Instance getInstance(String name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
* GetInstanceRequest request = GetInstanceRequest.newBuilder()
* .setName(name.toString())
* .build();
- * Instance response = bigtableInstanceAdminClient.getInstance(request);
+ * Instance response = baseBigtableInstanceAdminClient.getInstance(request);
* }
*
*
@@ -460,12 +462,12 @@ private final Instance getInstance(GetInstanceRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
* GetInstanceRequest request = GetInstanceRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<Instance> future = bigtableInstanceAdminClient.getInstanceCallable().futureCall(request);
+ * ApiFuture<Instance> future = baseBigtableInstanceAdminClient.getInstanceCallable().futureCall(request);
* // Do something
* Instance response = future.get();
* }
@@ -482,9 +484,9 @@ public final UnaryCallable getInstanceCallable() {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
- * ListInstancesResponse response = bigtableInstanceAdminClient.listInstances(parent);
+ * ListInstancesResponse response = baseBigtableInstanceAdminClient.listInstances(parent);
* }
*
*
@@ -508,9 +510,9 @@ public final ListInstancesResponse listInstances(ProjectName parent) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
- * ListInstancesResponse response = bigtableInstanceAdminClient.listInstances(parent.toString());
+ * ListInstancesResponse response = baseBigtableInstanceAdminClient.listInstances(parent.toString());
* }
*
*
@@ -531,12 +533,12 @@ public final ListInstancesResponse listInstances(String parent) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ListInstancesRequest request = ListInstancesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * ListInstancesResponse response = bigtableInstanceAdminClient.listInstances(request);
+ * ListInstancesResponse response = baseBigtableInstanceAdminClient.listInstances(request);
* }
*
*
@@ -554,12 +556,12 @@ public final ListInstancesResponse listInstances(ListInstancesRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ListInstancesRequest request = ListInstancesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * ApiFuture<ListInstancesResponse> future = bigtableInstanceAdminClient.listInstancesCallable().futureCall(request);
+ * ApiFuture<ListInstancesResponse> future = baseBigtableInstanceAdminClient.listInstancesCallable().futureCall(request);
* // Do something
* ListInstancesResponse response = future.get();
* }
@@ -576,10 +578,10 @@ public final UnaryCallable listInst
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* Instance instance = Instance.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
- * Instance response = bigtableInstanceAdminClient.partialUpdateInstanceAsync(instance, updateMask).get();
+ * Instance response = baseBigtableInstanceAdminClient.partialUpdateInstanceAsync(instance, updateMask).get();
* }
*
*
@@ -608,14 +610,14 @@ public final OperationFuture partialUpdateInst
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* Instance instance = Instance.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* PartialUpdateInstanceRequest request = PartialUpdateInstanceRequest.newBuilder()
* .setInstance(instance)
* .setUpdateMask(updateMask)
* .build();
- * Instance response = bigtableInstanceAdminClient.partialUpdateInstanceAsync(request).get();
+ * Instance response = baseBigtableInstanceAdminClient.partialUpdateInstanceAsync(request).get();
* }
*
*
@@ -636,14 +638,14 @@ public final OperationFuture partialUpdateInst
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* Instance instance = Instance.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* PartialUpdateInstanceRequest request = PartialUpdateInstanceRequest.newBuilder()
* .setInstance(instance)
* .setUpdateMask(updateMask)
* .build();
- * OperationFuture<Operation> future = bigtableInstanceAdminClient.partialUpdateInstanceOperationCallable().futureCall(request);
+ * OperationFuture<Operation> future = baseBigtableInstanceAdminClient.partialUpdateInstanceOperationCallable().futureCall(request);
* // Do something
* Instance response = future.get();
* }
@@ -662,14 +664,14 @@ public final OperationFuture partialUpdateInst
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* Instance instance = Instance.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* PartialUpdateInstanceRequest request = PartialUpdateInstanceRequest.newBuilder()
* .setInstance(instance)
* .setUpdateMask(updateMask)
* .build();
- * ApiFuture<Operation> future = bigtableInstanceAdminClient.partialUpdateInstanceCallable().futureCall(request);
+ * ApiFuture<Operation> future = baseBigtableInstanceAdminClient.partialUpdateInstanceCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
@@ -687,9 +689,9 @@ public final OperationFuture partialUpdateInst
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * bigtableInstanceAdminClient.deleteInstance(name);
+ * baseBigtableInstanceAdminClient.deleteInstance(name);
* }
*
*
@@ -711,9 +713,9 @@ public final void deleteInstance(InstanceName name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * bigtableInstanceAdminClient.deleteInstance(name.toString());
+ * baseBigtableInstanceAdminClient.deleteInstance(name.toString());
* }
*
*
@@ -734,12 +736,12 @@ public final void deleteInstance(String name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
* DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
* .setName(name.toString())
* .build();
- * bigtableInstanceAdminClient.deleteInstance(request);
+ * baseBigtableInstanceAdminClient.deleteInstance(request);
* }
*
*
@@ -757,12 +759,12 @@ private final void deleteInstance(DeleteInstanceRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
* DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<Void> future = bigtableInstanceAdminClient.deleteInstanceCallable().futureCall(request);
+ * ApiFuture<Void> future = baseBigtableInstanceAdminClient.deleteInstanceCallable().futureCall(request);
* // Do something
* future.get();
* }
@@ -779,11 +781,11 @@ public final UnaryCallable deleteInstanceCallable(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String clusterId = "";
* Cluster cluster = Cluster.newBuilder().build();
- * Cluster response = bigtableInstanceAdminClient.createClusterAsync(parent, clusterId, cluster).get();
+ * Cluster response = baseBigtableInstanceAdminClient.createClusterAsync(parent, clusterId, cluster).get();
* }
*
*
@@ -815,11 +817,11 @@ public final OperationFuture createClusterAsync(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String clusterId = "";
* Cluster cluster = Cluster.newBuilder().build();
- * Cluster response = bigtableInstanceAdminClient.createClusterAsync(parent.toString(), clusterId, cluster).get();
+ * Cluster response = baseBigtableInstanceAdminClient.createClusterAsync(parent.toString(), clusterId, cluster).get();
* }
*
*
@@ -851,7 +853,7 @@ public final OperationFuture createClusterAsync(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String clusterId = "";
* Cluster cluster = Cluster.newBuilder().build();
@@ -860,7 +862,7 @@ public final OperationFuture createClusterAsync(
* .setClusterId(clusterId)
* .setCluster(cluster)
* .build();
- * Cluster response = bigtableInstanceAdminClient.createClusterAsync(request).get();
+ * Cluster response = baseBigtableInstanceAdminClient.createClusterAsync(request).get();
* }
*
*
@@ -881,7 +883,7 @@ public final OperationFuture createClusterAsync(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String clusterId = "";
* Cluster cluster = Cluster.newBuilder().build();
@@ -890,7 +892,7 @@ public final OperationFuture createClusterAsync(
* .setClusterId(clusterId)
* .setCluster(cluster)
* .build();
- * OperationFuture<Operation> future = bigtableInstanceAdminClient.createClusterOperationCallable().futureCall(request);
+ * OperationFuture<Operation> future = baseBigtableInstanceAdminClient.createClusterOperationCallable().futureCall(request);
* // Do something
* Cluster response = future.get();
* }
@@ -909,7 +911,7 @@ public final OperationFuture createClusterAsync(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String clusterId = "";
* Cluster cluster = Cluster.newBuilder().build();
@@ -918,7 +920,7 @@ public final OperationFuture createClusterAsync(
* .setClusterId(clusterId)
* .setCluster(cluster)
* .build();
- * ApiFuture<Operation> future = bigtableInstanceAdminClient.createClusterCallable().futureCall(request);
+ * ApiFuture<Operation> future = baseBigtableInstanceAdminClient.createClusterCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
@@ -935,9 +937,9 @@ public final UnaryCallable createClusterCallabl
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * Cluster response = bigtableInstanceAdminClient.getCluster(name);
+ * Cluster response = baseBigtableInstanceAdminClient.getCluster(name);
* }
*
*
@@ -959,9 +961,9 @@ public final Cluster getCluster(ClusterName name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * Cluster response = bigtableInstanceAdminClient.getCluster(name.toString());
+ * Cluster response = baseBigtableInstanceAdminClient.getCluster(name.toString());
* }
*
*
@@ -982,12 +984,12 @@ public final Cluster getCluster(String name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
* GetClusterRequest request = GetClusterRequest.newBuilder()
* .setName(name.toString())
* .build();
- * Cluster response = bigtableInstanceAdminClient.getCluster(request);
+ * Cluster response = baseBigtableInstanceAdminClient.getCluster(request);
* }
*
*
@@ -1005,12 +1007,12 @@ private final Cluster getCluster(GetClusterRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
* GetClusterRequest request = GetClusterRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<Cluster> future = bigtableInstanceAdminClient.getClusterCallable().futureCall(request);
+ * ApiFuture<Cluster> future = baseBigtableInstanceAdminClient.getClusterCallable().futureCall(request);
* // Do something
* Cluster response = future.get();
* }
@@ -1027,9 +1029,9 @@ public final UnaryCallable getClusterCallable() {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * ListClustersResponse response = bigtableInstanceAdminClient.listClusters(parent);
+ * ListClustersResponse response = baseBigtableInstanceAdminClient.listClusters(parent);
* }
*
*
@@ -1055,9 +1057,9 @@ public final ListClustersResponse listClusters(InstanceName parent) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * ListClustersResponse response = bigtableInstanceAdminClient.listClusters(parent.toString());
+ * ListClustersResponse response = baseBigtableInstanceAdminClient.listClusters(parent.toString());
* }
*
*
@@ -1080,12 +1082,12 @@ public final ListClustersResponse listClusters(String parent) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* ListClustersRequest request = ListClustersRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * ListClustersResponse response = bigtableInstanceAdminClient.listClusters(request);
+ * ListClustersResponse response = baseBigtableInstanceAdminClient.listClusters(request);
* }
*
*
@@ -1103,12 +1105,12 @@ public final ListClustersResponse listClusters(ListClustersRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* ListClustersRequest request = ListClustersRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * ApiFuture<ListClustersResponse> future = bigtableInstanceAdminClient.listClustersCallable().futureCall(request);
+ * ApiFuture<ListClustersResponse> future = baseBigtableInstanceAdminClient.listClustersCallable().futureCall(request);
* // Do something
* ListClustersResponse response = future.get();
* }
@@ -1125,16 +1127,14 @@ public final UnaryCallable listCluste
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
* int serveNodes = 0;
* Cluster request = Cluster.newBuilder()
* .setName(name.toString())
- * .setLocation(location.toString())
* .setServeNodes(serveNodes)
* .build();
- * Cluster response = bigtableInstanceAdminClient.updateClusterAsync(request).get();
+ * Cluster response = baseBigtableInstanceAdminClient.updateClusterAsync(request).get();
* }
*
*
@@ -1154,16 +1154,14 @@ public final OperationFuture updateClusterAsync(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
* int serveNodes = 0;
* Cluster request = Cluster.newBuilder()
* .setName(name.toString())
- * .setLocation(location.toString())
* .setServeNodes(serveNodes)
* .build();
- * OperationFuture<Operation> future = bigtableInstanceAdminClient.updateClusterOperationCallable().futureCall(request);
+ * OperationFuture<Operation> future = baseBigtableInstanceAdminClient.updateClusterOperationCallable().futureCall(request);
* // Do something
* Cluster response = future.get();
* }
@@ -1182,16 +1180,14 @@ public final OperationFuture updateClusterAsync(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
* int serveNodes = 0;
* Cluster request = Cluster.newBuilder()
* .setName(name.toString())
- * .setLocation(location.toString())
* .setServeNodes(serveNodes)
* .build();
- * ApiFuture<Operation> future = bigtableInstanceAdminClient.updateClusterCallable().futureCall(request);
+ * ApiFuture<Operation> future = baseBigtableInstanceAdminClient.updateClusterCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
@@ -1208,9 +1204,9 @@ public final UnaryCallable updateClusterCallable() {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * bigtableInstanceAdminClient.deleteCluster(name);
+ * baseBigtableInstanceAdminClient.deleteCluster(name);
* }
*
*
@@ -1232,9 +1228,9 @@ public final void deleteCluster(ClusterName name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * bigtableInstanceAdminClient.deleteCluster(name.toString());
+ * baseBigtableInstanceAdminClient.deleteCluster(name.toString());
* }
*
*
@@ -1255,12 +1251,12 @@ public final void deleteCluster(String name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
* DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
* .setName(name.toString())
* .build();
- * bigtableInstanceAdminClient.deleteCluster(request);
+ * baseBigtableInstanceAdminClient.deleteCluster(request);
* }
*
*
@@ -1278,12 +1274,12 @@ private final void deleteCluster(DeleteClusterRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
* DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<Void> future = bigtableInstanceAdminClient.deleteClusterCallable().futureCall(request);
+ * ApiFuture<Void> future = baseBigtableInstanceAdminClient.deleteClusterCallable().futureCall(request);
* // Do something
* future.get();
* }
@@ -1300,11 +1296,11 @@ public final UnaryCallable deleteClusterCallable()
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String appProfileId = "";
* AppProfile appProfile = AppProfile.newBuilder().build();
- * AppProfile response = bigtableInstanceAdminClient.createAppProfile(parent, appProfileId, appProfile);
+ * AppProfile response = baseBigtableInstanceAdminClient.createAppProfile(parent, appProfileId, appProfile);
* }
*
*
@@ -1335,11 +1331,11 @@ public final AppProfile createAppProfile(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String appProfileId = "";
* AppProfile appProfile = AppProfile.newBuilder().build();
- * AppProfile response = bigtableInstanceAdminClient.createAppProfile(parent.toString(), appProfileId, appProfile);
+ * AppProfile response = baseBigtableInstanceAdminClient.createAppProfile(parent.toString(), appProfileId, appProfile);
* }
*
*
@@ -1370,7 +1366,7 @@ public final AppProfile createAppProfile(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String appProfileId = "";
* AppProfile appProfile = AppProfile.newBuilder().build();
@@ -1379,7 +1375,7 @@ public final AppProfile createAppProfile(
* .setAppProfileId(appProfileId)
* .setAppProfile(appProfile)
* .build();
- * AppProfile response = bigtableInstanceAdminClient.createAppProfile(request);
+ * AppProfile response = baseBigtableInstanceAdminClient.createAppProfile(request);
* }
*
*
@@ -1397,7 +1393,7 @@ public final AppProfile createAppProfile(CreateAppProfileRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* String appProfileId = "";
* AppProfile appProfile = AppProfile.newBuilder().build();
@@ -1406,7 +1402,7 @@ public final AppProfile createAppProfile(CreateAppProfileRequest request) {
* .setAppProfileId(appProfileId)
* .setAppProfile(appProfile)
* .build();
- * ApiFuture<AppProfile> future = bigtableInstanceAdminClient.createAppProfileCallable().futureCall(request);
+ * ApiFuture<AppProfile> future = baseBigtableInstanceAdminClient.createAppProfileCallable().futureCall(request);
* // Do something
* AppProfile response = future.get();
* }
@@ -1423,9 +1419,9 @@ public final UnaryCallable createAppProfile
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
- * AppProfile response = bigtableInstanceAdminClient.getAppProfile(name);
+ * AppProfile response = baseBigtableInstanceAdminClient.getAppProfile(name);
* }
*
*
@@ -1447,9 +1443,9 @@ public final AppProfile getAppProfile(AppProfileName name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
- * AppProfile response = bigtableInstanceAdminClient.getAppProfile(name.toString());
+ * AppProfile response = baseBigtableInstanceAdminClient.getAppProfile(name.toString());
* }
*
*
@@ -1470,12 +1466,12 @@ public final AppProfile getAppProfile(String name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
* GetAppProfileRequest request = GetAppProfileRequest.newBuilder()
* .setName(name.toString())
* .build();
- * AppProfile response = bigtableInstanceAdminClient.getAppProfile(request);
+ * AppProfile response = baseBigtableInstanceAdminClient.getAppProfile(request);
* }
*
*
@@ -1493,12 +1489,12 @@ private final AppProfile getAppProfile(GetAppProfileRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
* GetAppProfileRequest request = GetAppProfileRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<AppProfile> future = bigtableInstanceAdminClient.getAppProfileCallable().futureCall(request);
+ * ApiFuture<AppProfile> future = baseBigtableInstanceAdminClient.getAppProfileCallable().futureCall(request);
* // Do something
* AppProfile response = future.get();
* }
@@ -1515,9 +1511,9 @@ public final UnaryCallable getAppProfileCallab
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * for (AppProfile element : bigtableInstanceAdminClient.listAppProfiles(parent).iterateAll()) {
+ * for (AppProfile element : baseBigtableInstanceAdminClient.listAppProfiles(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -1542,9 +1538,9 @@ public final ListAppProfilesPagedResponse listAppProfiles(InstanceName parent) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * for (AppProfile element : bigtableInstanceAdminClient.listAppProfiles(parent.toString()).iterateAll()) {
+ * for (AppProfile element : baseBigtableInstanceAdminClient.listAppProfiles(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -1566,12 +1562,12 @@ public final ListAppProfilesPagedResponse listAppProfiles(String parent) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* ListAppProfilesRequest request = ListAppProfilesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * for (AppProfile element : bigtableInstanceAdminClient.listAppProfiles(request).iterateAll()) {
+ * for (AppProfile element : baseBigtableInstanceAdminClient.listAppProfiles(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -1591,12 +1587,12 @@ public final ListAppProfilesPagedResponse listAppProfiles(ListAppProfilesRequest
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* ListAppProfilesRequest request = ListAppProfilesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * ApiFuture<ListAppProfilesPagedResponse> future = bigtableInstanceAdminClient.listAppProfilesPagedCallable().futureCall(request);
+ * ApiFuture<ListAppProfilesPagedResponse> future = baseBigtableInstanceAdminClient.listAppProfilesPagedCallable().futureCall(request);
* // Do something
* for (AppProfile element : future.get().iterateAll()) {
* // doThingsWith(element);
@@ -1616,13 +1612,13 @@ public final ListAppProfilesPagedResponse listAppProfiles(ListAppProfilesRequest
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
* ListAppProfilesRequest request = ListAppProfilesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
* while (true) {
- * ListAppProfilesResponse response = bigtableInstanceAdminClient.listAppProfilesCallable().call(request);
+ * ListAppProfilesResponse response = baseBigtableInstanceAdminClient.listAppProfilesCallable().call(request);
* for (AppProfile element : response.getAppProfilesList()) {
* // doThingsWith(element);
* }
@@ -1648,10 +1644,10 @@ public final ListAppProfilesPagedResponse listAppProfiles(ListAppProfilesRequest
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfile appProfile = AppProfile.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
- * AppProfile response = bigtableInstanceAdminClient.updateAppProfileAsync(appProfile, updateMask).get();
+ * AppProfile response = baseBigtableInstanceAdminClient.updateAppProfileAsync(appProfile, updateMask).get();
* }
*
*
@@ -1680,14 +1676,14 @@ public final OperationFuture updateAppProf
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfile appProfile = AppProfile.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* UpdateAppProfileRequest request = UpdateAppProfileRequest.newBuilder()
* .setAppProfile(appProfile)
* .setUpdateMask(updateMask)
* .build();
- * AppProfile response = bigtableInstanceAdminClient.updateAppProfileAsync(request).get();
+ * AppProfile response = baseBigtableInstanceAdminClient.updateAppProfileAsync(request).get();
* }
*
*
@@ -1708,14 +1704,14 @@ public final OperationFuture updateAppProf
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfile appProfile = AppProfile.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* UpdateAppProfileRequest request = UpdateAppProfileRequest.newBuilder()
* .setAppProfile(appProfile)
* .setUpdateMask(updateMask)
* .build();
- * OperationFuture<Operation> future = bigtableInstanceAdminClient.updateAppProfileOperationCallable().futureCall(request);
+ * OperationFuture<Operation> future = baseBigtableInstanceAdminClient.updateAppProfileOperationCallable().futureCall(request);
* // Do something
* AppProfile response = future.get();
* }
@@ -1734,14 +1730,14 @@ public final OperationFuture updateAppProf
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfile appProfile = AppProfile.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* UpdateAppProfileRequest request = UpdateAppProfileRequest.newBuilder()
* .setAppProfile(appProfile)
* .setUpdateMask(updateMask)
* .build();
- * ApiFuture<Operation> future = bigtableInstanceAdminClient.updateAppProfileCallable().futureCall(request);
+ * ApiFuture<Operation> future = baseBigtableInstanceAdminClient.updateAppProfileCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
@@ -1758,9 +1754,9 @@ public final UnaryCallable updateAppProfileC
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
- * bigtableInstanceAdminClient.deleteAppProfile(name);
+ * baseBigtableInstanceAdminClient.deleteAppProfile(name);
* }
*
*
@@ -1782,9 +1778,9 @@ public final void deleteAppProfile(AppProfileName name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
- * bigtableInstanceAdminClient.deleteAppProfile(name.toString());
+ * baseBigtableInstanceAdminClient.deleteAppProfile(name.toString());
* }
*
*
@@ -1805,14 +1801,14 @@ public final void deleteAppProfile(String name) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
* boolean ignoreWarnings = false;
* DeleteAppProfileRequest request = DeleteAppProfileRequest.newBuilder()
* .setName(name.toString())
* .setIgnoreWarnings(ignoreWarnings)
* .build();
- * bigtableInstanceAdminClient.deleteAppProfile(request);
+ * baseBigtableInstanceAdminClient.deleteAppProfile(request);
* }
*
*
@@ -1830,14 +1826,14 @@ public final void deleteAppProfile(DeleteAppProfileRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
* boolean ignoreWarnings = false;
* DeleteAppProfileRequest request = DeleteAppProfileRequest.newBuilder()
* .setName(name.toString())
* .setIgnoreWarnings(ignoreWarnings)
* .build();
- * ApiFuture<Void> future = bigtableInstanceAdminClient.deleteAppProfileCallable().futureCall(request);
+ * ApiFuture<Void> future = baseBigtableInstanceAdminClient.deleteAppProfileCallable().futureCall(request);
* // Do something
* future.get();
* }
@@ -1855,9 +1851,9 @@ public final UnaryCallable deleteAppProfileCalla
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
- * Policy response = bigtableInstanceAdminClient.getIamPolicy(formattedResource);
+ * Policy response = baseBigtableInstanceAdminClient.getIamPolicy(formattedResource);
* }
*
*
@@ -1880,12 +1876,12 @@ public final Policy getIamPolicy(String resource) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
* GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
* .setResource(formattedResource)
* .build();
- * Policy response = bigtableInstanceAdminClient.getIamPolicy(request);
+ * Policy response = baseBigtableInstanceAdminClient.getIamPolicy(request);
* }
*
*
@@ -1904,12 +1900,12 @@ private final Policy getIamPolicy(GetIamPolicyRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
* GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
* .setResource(formattedResource)
* .build();
- * ApiFuture<Policy> future = bigtableInstanceAdminClient.getIamPolicyCallable().futureCall(request);
+ * ApiFuture<Policy> future = baseBigtableInstanceAdminClient.getIamPolicyCallable().futureCall(request);
* // Do something
* Policy response = future.get();
* }
@@ -1926,10 +1922,10 @@ public final UnaryCallable getIamPolicyCallable() {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
* Policy policy = Policy.newBuilder().build();
- * Policy response = bigtableInstanceAdminClient.setIamPolicy(formattedResource, policy);
+ * Policy response = baseBigtableInstanceAdminClient.setIamPolicy(formattedResource, policy);
* }
*
*
@@ -1955,14 +1951,14 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
* Policy policy = Policy.newBuilder().build();
* SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
* .setResource(formattedResource)
* .setPolicy(policy)
* .build();
- * Policy response = bigtableInstanceAdminClient.setIamPolicy(request);
+ * Policy response = baseBigtableInstanceAdminClient.setIamPolicy(request);
* }
*
*
@@ -1980,14 +1976,14 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
* Policy policy = Policy.newBuilder().build();
* SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
* .setResource(formattedResource)
* .setPolicy(policy)
* .build();
- * ApiFuture<Policy> future = bigtableInstanceAdminClient.setIamPolicyCallable().futureCall(request);
+ * ApiFuture<Policy> future = baseBigtableInstanceAdminClient.setIamPolicyCallable().futureCall(request);
* // Do something
* Policy response = future.get();
* }
@@ -2004,10 +2000,10 @@ public final UnaryCallable setIamPolicyCallable() {
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
* List<String> permissions = new ArrayList<>();
- * TestIamPermissionsResponse response = bigtableInstanceAdminClient.testIamPermissions(formattedResource, permissions);
+ * TestIamPermissionsResponse response = baseBigtableInstanceAdminClient.testIamPermissions(formattedResource, permissions);
* }
*
*
@@ -2037,14 +2033,14 @@ public final TestIamPermissionsResponse testIamPermissions(
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
* List<String> permissions = new ArrayList<>();
* TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
* .setResource(formattedResource)
* .addAllPermissions(permissions)
* .build();
- * TestIamPermissionsResponse response = bigtableInstanceAdminClient.testIamPermissions(request);
+ * TestIamPermissionsResponse response = baseBigtableInstanceAdminClient.testIamPermissions(request);
* }
*
*
@@ -2062,14 +2058,14 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* Sample code:
*
*
- * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient.create()) {
* String formattedResource = InstanceName.format("[PROJECT]", "[INSTANCE]");
* List<String> permissions = new ArrayList<>();
* TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
* .setResource(formattedResource)
* .addAllPermissions(permissions)
* .build();
- * ApiFuture<TestIamPermissionsResponse> future = bigtableInstanceAdminClient.testIamPermissionsCallable().futureCall(request);
+ * ApiFuture<TestIamPermissionsResponse> future = baseBigtableInstanceAdminClient.testIamPermissionsCallable().futureCall(request);
* // Do something
* TestIamPermissionsResponse response = future.get();
* }
diff --git a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java
similarity index 94%
rename from google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java
rename to google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java
index be3c9e201fc9..8069e05658b6 100644
--- a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java
+++ b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java
@@ -15,7 +15,7 @@
*/
package com.google.cloud.bigtable.admin.v2;
-import static com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient.ListAppProfilesPagedResponse;
+import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse;
import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
@@ -68,7 +68,7 @@
// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
- * Settings class to configure an instance of {@link BigtableInstanceAdminClient}.
+ * Settings class to configure an instance of {@link BaseBigtableInstanceAdminClient}.
*
* The default instance has everything set to sensible defaults:
*
@@ -84,17 +84,18 @@
*
*
*
- * BigtableInstanceAdminSettings.Builder bigtableInstanceAdminSettingsBuilder =
- * BigtableInstanceAdminSettings.newBuilder();
- * bigtableInstanceAdminSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder()
+ * BaseBigtableInstanceAdminSettings.Builder baseBigtableInstanceAdminSettingsBuilder =
+ * BaseBigtableInstanceAdminSettings.newBuilder();
+ * baseBigtableInstanceAdminSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30));
- * BigtableInstanceAdminSettings bigtableInstanceAdminSettings = bigtableInstanceAdminSettingsBuilder.build();
+ * BaseBigtableInstanceAdminSettings baseBigtableInstanceAdminSettings = baseBigtableInstanceAdminSettingsBuilder.build();
*
*
*/
@Generated("by gapic-generator")
@BetaApi
-public class BigtableInstanceAdminSettings extends ClientSettings {
+public class BaseBigtableInstanceAdminSettings
+ extends ClientSettings {
/** Returns the object with the settings used for calls to createInstance. */
public UnaryCallSettings createInstanceSettings() {
return ((BigtableInstanceAdminStubSettings) getStubSettings()).createInstanceSettings();
@@ -232,9 +233,9 @@ public UnaryCallSettings setIamPolicySettings() {
return ((BigtableInstanceAdminStubSettings) getStubSettings()).testIamPermissionsSettings();
}
- public static final BigtableInstanceAdminSettings create(BigtableInstanceAdminStubSettings stub)
- throws IOException {
- return new BigtableInstanceAdminSettings.Builder(stub.toBuilder()).build();
+ public static final BaseBigtableInstanceAdminSettings create(
+ BigtableInstanceAdminStubSettings stub) throws IOException {
+ return new BaseBigtableInstanceAdminSettings.Builder(stub.toBuilder()).build();
}
/** Returns a builder for the default ExecutorProvider for this service. */
@@ -286,13 +287,13 @@ public Builder toBuilder() {
return new Builder(this);
}
- protected BigtableInstanceAdminSettings(Builder settingsBuilder) throws IOException {
+ protected BaseBigtableInstanceAdminSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
}
- /** Builder for BigtableInstanceAdminSettings. */
+ /** Builder for BaseBigtableInstanceAdminSettings. */
public static class Builder
- extends ClientSettings.Builder {
+ extends ClientSettings.Builder {
protected Builder() throws IOException {
this((ClientContext) null);
}
@@ -305,7 +306,7 @@ private static Builder createDefault() {
return new Builder(BigtableInstanceAdminStubSettings.newBuilder());
}
- protected Builder(BigtableInstanceAdminSettings settings) {
+ protected Builder(BaseBigtableInstanceAdminSettings settings) {
super(settings.getStubSettings().toBuilder());
}
@@ -471,8 +472,8 @@ public UnaryCallSettings.Builder setIamPolicySettin
}
@Override
- public BigtableInstanceAdminSettings build() throws IOException {
- return new BigtableInstanceAdminSettings(this);
+ public BaseBigtableInstanceAdminSettings build() throws IOException {
+ return new BaseBigtableInstanceAdminSettings(this);
}
}
}
diff --git a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java
new file mode 100644
index 000000000000..168d78d71cd3
--- /dev/null
+++ b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java
@@ -0,0 +1,1981 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.bigtable.admin.v2;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.bigtable.admin.v2.CheckConsistencyRequest;
+import com.google.bigtable.admin.v2.CheckConsistencyResponse;
+import com.google.bigtable.admin.v2.ClusterName;
+import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata;
+import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest;
+import com.google.bigtable.admin.v2.CreateTableRequest;
+import com.google.bigtable.admin.v2.DeleteSnapshotRequest;
+import com.google.bigtable.admin.v2.DeleteTableRequest;
+import com.google.bigtable.admin.v2.DropRowRangeRequest;
+import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest;
+import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse;
+import com.google.bigtable.admin.v2.GetSnapshotRequest;
+import com.google.bigtable.admin.v2.GetTableRequest;
+import com.google.bigtable.admin.v2.InstanceName;
+import com.google.bigtable.admin.v2.ListSnapshotsRequest;
+import com.google.bigtable.admin.v2.ListSnapshotsResponse;
+import com.google.bigtable.admin.v2.ListTablesRequest;
+import com.google.bigtable.admin.v2.ListTablesResponse;
+import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest;
+import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification;
+import com.google.bigtable.admin.v2.Snapshot;
+import com.google.bigtable.admin.v2.SnapshotName;
+import com.google.bigtable.admin.v2.SnapshotTableMetadata;
+import com.google.bigtable.admin.v2.SnapshotTableRequest;
+import com.google.bigtable.admin.v2.Table;
+import com.google.bigtable.admin.v2.TableName;
+import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStub;
+import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings;
+import com.google.longrunning.Operation;
+import com.google.longrunning.OperationsClient;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * Service Description: Service for creating, configuring, and deleting Cloud Bigtable tables.
+ *
+ * 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:
+ *
+ *
+ * - A "flattened" method. With this type of method, the fields of the request type have been
+ * converted into function parameters. It may be the case that not all fields are available as
+ * parameters, and not every API method will have a flattened method entry point.
+ *
- A "request object" method. This type of method only takes one parameter, a request object,
+ * which must be constructed before the call. Not every API method will have a request object
+ * method.
+ *
- A "callable" method. This type of method takes no parameters and returns an immutable API
+ * callable object, which can be used to initiate calls to the service.
+ *
+ *
+ * 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);
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class BaseBigtableTableAdminClient implements BackgroundResource {
+ private final BaseBigtableTableAdminSettings settings;
+ private final BigtableTableAdminStub stub;
+ private final OperationsClient operationsClient;
+
+ /** Constructs an instance of BaseBigtableTableAdminClient with default settings. */
+ public static final BaseBigtableTableAdminClient create() throws IOException {
+ return create(BaseBigtableTableAdminSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of BaseBigtableTableAdminClient, using the given settings. The channels
+ * are created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final BaseBigtableTableAdminClient create(BaseBigtableTableAdminSettings settings)
+ throws IOException {
+ return new BaseBigtableTableAdminClient(settings);
+ }
+
+ /**
+ * Constructs an instance of BaseBigtableTableAdminClient, using the given stub for making calls.
+ * This is for advanced usage - prefer to use BaseBigtableTableAdminSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final BaseBigtableTableAdminClient create(BigtableTableAdminStub stub) {
+ return new BaseBigtableTableAdminClient(stub);
+ }
+
+ /**
+ * Constructs an instance of BaseBigtableTableAdminClient, using the given settings. This is
+ * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+ * should be preferred.
+ */
+ protected BaseBigtableTableAdminClient(BaseBigtableTableAdminSettings settings)
+ throws IOException {
+ this.settings = settings;
+ this.stub = ((BigtableTableAdminStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected BaseBigtableTableAdminClient(BigtableTableAdminStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final BaseBigtableTableAdminSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public BigtableTableAdminStub getStub() {
+ return stub;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table in the specified instance. The table can be created with a full set of
+ * initial column families, specified in the request.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param parent The unique name of the instance in which to create the table. Values are of the
+ * form `projects/<project>/instances/<instance>`.
+ * @param tableId The name by which the new table should be referred to within the parent
+ * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
+ * @param table The Table to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table createTable(InstanceName parent, String tableId, Table table) {
+
+ CreateTableRequest request =
+ CreateTableRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTableId(tableId)
+ .setTable(table)
+ .build();
+ return createTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table in the specified instance. The table can be created with a full set of
+ * initial column families, specified in the request.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param parent The unique name of the instance in which to create the table. Values are of the
+ * form `projects/<project>/instances/<instance>`.
+ * @param tableId The name by which the new table should be referred to within the parent
+ * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
+ * @param table The Table to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table createTable(String parent, String tableId, Table table) {
+
+ CreateTableRequest request =
+ CreateTableRequest.newBuilder()
+ .setParent(parent)
+ .setTableId(tableId)
+ .setTable(table)
+ .build();
+ return createTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table in the specified instance. The table can be created with a full set of
+ * initial column families, specified in the 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table createTable(CreateTableRequest request) {
+ return createTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table in the specified instance. The table can be created with a full set of
+ * initial column families, specified in the 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();
+ * ApiFuture<Table> future = baseBigtableTableAdminClient.createTableCallable().futureCall(request);
+ * // Do something
+ * Table response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallable createTableCallable() {
+ return stub.createTableCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
+ * and the table must be in the same instance.
+ *
+ * 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();
+ * }
+ *
+ *
+ * @param parent The unique name of the instance in which to create the table. Values are of the
+ * form `projects/<project>/instances/<instance>`.
+ * @param tableId The name by which the new table should be referred to within the parent
+ * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
+ * @param 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>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture createTableFromSnapshotAsync(
+ InstanceName parent, String tableId, SnapshotName sourceSnapshot) {
+
+ CreateTableFromSnapshotRequest request =
+ CreateTableFromSnapshotRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTableId(tableId)
+ .setSourceSnapshot(sourceSnapshot == null ? null : sourceSnapshot.toString())
+ .build();
+ return createTableFromSnapshotAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
+ * and the table must be in the same instance.
+ *
+ * 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();
+ * }
+ *
+ *
+ * @param parent The unique name of the instance in which to create the table. Values are of the
+ * form `projects/<project>/instances/<instance>`.
+ * @param tableId The name by which the new table should be referred to within the parent
+ * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
+ * @param 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>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture createTableFromSnapshotAsync(
+ String parent, String tableId, String sourceSnapshot) {
+
+ CreateTableFromSnapshotRequest request =
+ CreateTableFromSnapshotRequest.newBuilder()
+ .setParent(parent)
+ .setTableId(tableId)
+ .setSourceSnapshot(sourceSnapshot)
+ .build();
+ return createTableFromSnapshotAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
+ * and the table must be in the same instance.
+ *
+ * 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();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture createTableFromSnapshotAsync(
+ CreateTableFromSnapshotRequest request) {
+ return createTableFromSnapshotOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
+ * and the table must be in the same instance.
+ *
+ * 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<Operation> future = baseBigtableTableAdminClient.createTableFromSnapshotOperationCallable().futureCall(request);
+ * // Do something
+ * Table response = future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable<
+ CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata>
+ createTableFromSnapshotOperationCallable() {
+ return stub.createTableFromSnapshotOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
+ * and the table must be in the same instance.
+ *
+ * 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 UnaryCallable
+ createTableFromSnapshotCallable() {
+ return stub.createTableFromSnapshotCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all tables served from a specified instance.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * for (Table element : baseBigtableTableAdminClient.listTables(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent The unique name of the instance for which tables should be listed. Values are of
+ * the form `projects/<project>/instances/<instance>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTablesPagedResponse listTables(InstanceName parent) {
+ ListTablesRequest request =
+ ListTablesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listTables(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all tables served from a specified instance.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * for (Table element : baseBigtableTableAdminClient.listTables(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent The unique name of the instance for which tables should be listed. Values are of
+ * the form `projects/<project>/instances/<instance>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTablesPagedResponse listTables(String parent) {
+ ListTablesRequest request = ListTablesRequest.newBuilder().setParent(parent).build();
+ return listTables(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all tables served from a specified instance.
+ *
+ * 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);
+ * }
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTablesPagedResponse listTables(ListTablesRequest request) {
+ return listTablesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all tables served from a specified instance.
+ *
+ * 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 listTablesPagedCallable() {
+ return stub.listTablesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all tables served from a specified instance.
+ *
+ * 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 UnaryCallable listTablesCallable() {
+ return stub.listTablesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified table.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * Table response = baseBigtableTableAdminClient.getTable(name);
+ * }
+ *
+ *
+ * @param name The unique name of the requested table. Values are of the form
+ * `projects/<project>/instances/<instance>/tables/<table>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table getTable(TableName name) {
+
+ GetTableRequest request =
+ GetTableRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified table.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * Table response = baseBigtableTableAdminClient.getTable(name.toString());
+ * }
+ *
+ *
+ * @param name The unique name of the requested table. Values are of the form
+ * `projects/<project>/instances/<instance>/tables/<table>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table getTable(String name) {
+
+ GetTableRequest request = GetTableRequest.newBuilder().setName(name).build();
+ return getTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified table.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table getTable(GetTableRequest request) {
+ return getTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified table.
+ *
+ * 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 UnaryCallable getTableCallable() {
+ return stub.getTableCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes a specified table and all of its data.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * baseBigtableTableAdminClient.deleteTable(name);
+ * }
+ *
+ *
+ * @param name The unique name of the table to be deleted. Values are of the form
+ * `projects/<project>/instances/<instance>/tables/<table>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteTable(TableName name) {
+
+ DeleteTableRequest request =
+ DeleteTableRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes a specified table and all of its data.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * baseBigtableTableAdminClient.deleteTable(name.toString());
+ * }
+ *
+ *
+ * @param name The unique name of the table to be deleted. Values are of the form
+ * `projects/<project>/instances/<instance>/tables/<table>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteTable(String name) {
+
+ DeleteTableRequest request = DeleteTableRequest.newBuilder().setName(name).build();
+ deleteTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes a specified table and all of its data.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final void deleteTable(DeleteTableRequest request) {
+ deleteTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes a specified table and all of its data.
+ *
+ * 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 UnaryCallable deleteTableCallable() {
+ return stub.deleteTableCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Performs a series of column family modifications on the specified table. Either all or none of
+ * the modifications will occur before this method returns, but data requests received prior to
+ * that point may see a table where only some modifications have taken effect.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param name The unique name of the table whose families should be modified. Values are of the
+ * form `projects/<project>/instances/<instance>/tables/<table>`.
+ * @param 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).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table modifyColumnFamilies(
+ TableName name, List modifications) {
+
+ ModifyColumnFamiliesRequest request =
+ ModifyColumnFamiliesRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .addAllModifications(modifications)
+ .build();
+ return modifyColumnFamilies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Performs a series of column family modifications on the specified table. Either all or none of
+ * the modifications will occur before this method returns, but data requests received prior to
+ * that point may see a table where only some modifications have taken effect.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param name The unique name of the table whose families should be modified. Values are of the
+ * form `projects/<project>/instances/<instance>/tables/<table>`.
+ * @param 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).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table modifyColumnFamilies(
+ String name, List modifications) {
+
+ ModifyColumnFamiliesRequest request =
+ ModifyColumnFamiliesRequest.newBuilder()
+ .setName(name)
+ .addAllModifications(modifications)
+ .build();
+ return modifyColumnFamilies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Performs a series of column family modifications on the specified table. Either all or none of
+ * the modifications will occur before this method returns, but data requests received prior to
+ * that point may see a table where only some modifications have taken effect.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table modifyColumnFamilies(ModifyColumnFamiliesRequest request) {
+ return modifyColumnFamiliesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Performs a series of column family modifications on the specified table. Either all or none of
+ * the modifications will occur before this method returns, but data requests received prior to
+ * that point may see a table where only some modifications have taken effect.
+ *
+ * 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 UnaryCallable modifyColumnFamiliesCallable() {
+ return stub.modifyColumnFamiliesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently drop/delete a row range from a specified table. The request can specify whether to
+ * delete all rows in a table, or only those that match a particular prefix.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void dropRowRange(DropRowRangeRequest request) {
+ dropRowRangeCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently drop/delete a row range from a specified table. The request can specify whether to
+ * delete all rows in a table, or only those that match a particular prefix.
+ *
+ * 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 UnaryCallable dropRowRangeCallable() {
+ return stub.dropRowRangeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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. The
+ * tokens will be available for 90 days.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * GenerateConsistencyTokenResponse response = baseBigtableTableAdminClient.generateConsistencyToken(name);
+ * }
+ *
+ *
+ * @param 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>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final GenerateConsistencyTokenResponse generateConsistencyToken(TableName name) {
+
+ GenerateConsistencyTokenRequest request =
+ GenerateConsistencyTokenRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return generateConsistencyToken(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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. The
+ * tokens will be available for 90 days.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * GenerateConsistencyTokenResponse response = baseBigtableTableAdminClient.generateConsistencyToken(name.toString());
+ * }
+ *
+ *
+ * @param 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>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final GenerateConsistencyTokenResponse generateConsistencyToken(String name) {
+
+ GenerateConsistencyTokenRequest request =
+ GenerateConsistencyTokenRequest.newBuilder().setName(name).build();
+ return generateConsistencyToken(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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. The
+ * tokens will be available for 90 days.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final GenerateConsistencyTokenResponse generateConsistencyToken(
+ GenerateConsistencyTokenRequest request) {
+ return generateConsistencyTokenCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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. The
+ * tokens will be available for 90 days.
+ *
+ * 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 UnaryCallable
+ generateConsistencyTokenCallable() {
+ return stub.generateConsistencyTokenCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * String consistencyToken = "";
+ * CheckConsistencyResponse response = baseBigtableTableAdminClient.checkConsistency(name, consistencyToken);
+ * }
+ *
+ *
+ * @param name The unique name of the Table for which to check replication consistency. Values are
+ * of the form `projects/<project>/instances/<instance>/tables/<table>`.
+ * @param consistencyToken The token created using GenerateConsistencyToken for the Table.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CheckConsistencyResponse checkConsistency(TableName name, String consistencyToken) {
+
+ CheckConsistencyRequest request =
+ CheckConsistencyRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setConsistencyToken(consistencyToken)
+ .build();
+ return checkConsistency(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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.
+ *
+ * Sample code:
+ *
+ *
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * String consistencyToken = "";
+ * CheckConsistencyResponse response = baseBigtableTableAdminClient.checkConsistency(name.toString(), consistencyToken);
+ * }
+ *
+ *
+ * @param name The unique name of the Table for which to check replication consistency. Values are
+ * of the form `projects/<project>/instances/<instance>/tables/<table>`.
+ * @param consistencyToken The token created using GenerateConsistencyToken for the Table.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CheckConsistencyResponse checkConsistency(String name, String consistencyToken) {
+
+ CheckConsistencyRequest request =
+ CheckConsistencyRequest.newBuilder()
+ .setName(name)
+ .setConsistencyToken(consistencyToken)
+ .build();
+ return checkConsistency(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CheckConsistencyResponse checkConsistency(CheckConsistencyRequest request) {
+ return checkConsistencyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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.
+ *
+ * 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();
+ * }
+ *
+ */
+ public final UnaryCallable
+ checkConsistencyCallable() {
+ return stub.checkConsistencyCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new snapshot in the specified cluster from the specified source table. The cluster
+ * and the table must be in the same instance.
+ *
+ * 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();
+ * }
+ *
+ *
+ * @param name The unique name of the table to have the snapshot taken. Values are of the form
+ * `projects/<project>/instances/<instance>/tables/<table>`.
+ * @param cluster The name of the cluster where the snapshot will be created in. Values are of the
+ * form `projects/<project>/instances/<instance>/clusters/<cluster>`.
+ * @param 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`.
+ * @param description Description of the snapshot.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture snapshotTableAsync(
+ TableName name, ClusterName cluster, SnapshotName snapshotId, String description) {
+
+ SnapshotTableRequest request =
+ SnapshotTableRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setCluster(cluster == null ? null : cluster.toString())
+ .setSnapshotId(snapshotId == null ? null : snapshotId.toString())
+ .setDescription(description)
+ .build();
+ return snapshotTableAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new snapshot in the specified cluster from the specified source table. The cluster
+ * and the table must be in the same instance.
+ *
+ * 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();
+ * }
+ *
+ *
+ * @param name The unique name of the table to have the snapshot taken. Values are of the form
+ * `projects/<project>/instances/<instance>/tables/<table>`.
+ * @param cluster The name of the cluster where the snapshot will be created in. Values are of the
+ * form `projects/<project>/instances/<instance>/clusters/<cluster>`.
+ * @param 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`.
+ * @param description Description of the snapshot.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture snapshotTableAsync(
+ String name, String cluster, String snapshotId, String description) {
+
+ SnapshotTableRequest request =
+ SnapshotTableRequest.newBuilder()
+ .setName(name)
+ .setCluster(cluster)
+ .setSnapshotId(snapshotId)
+ .setDescription(description)
+ .build();
+ return snapshotTableAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new snapshot in the specified cluster from the specified source table. The cluster
+ * and the table must be in the same instance.
+ *
+ * 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();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture snapshotTableAsync(
+ SnapshotTableRequest request) {
+ return snapshotTableOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new snapshot in the specified cluster from the specified source table. The cluster
+ * and the table must be in the same instance.
+ *
+ * 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<Operation> future = baseBigtableTableAdminClient.snapshotTableOperationCallable().futureCall(request);
+ * // Do something
+ * Snapshot response = future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ snapshotTableOperationCallable() {
+ return stub.snapshotTableOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new snapshot in the specified cluster from the specified source table. The cluster
+ * and the table must be in the same instance.
+ *
+ * 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 UnaryCallable snapshotTableCallable() {
+ return stub.snapshotTableCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified snapshot.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param name The unique name of the requested snapshot. Values are of the form
+ * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Snapshot getSnapshot(SnapshotName name) {
+
+ GetSnapshotRequest request =
+ GetSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getSnapshot(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified snapshot.
+ *
+ * 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());
+ * }
+ *
+ *
+ * @param name The unique name of the requested snapshot. Values are of the form
+ * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Snapshot getSnapshot(String name) {
+
+ GetSnapshotRequest request = GetSnapshotRequest.newBuilder().setName(name).build();
+ return getSnapshot(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified snapshot.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final Snapshot getSnapshot(GetSnapshotRequest request) {
+ return getSnapshotCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified snapshot.
+ *
+ * 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 UnaryCallable getSnapshotCallable() {
+ return stub.getSnapshotCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all snapshots associated with the specified cluster.
+ *
+ * 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);
+ * }
+ * }
+ *
+ *
+ * @param 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/-`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSnapshotsPagedResponse listSnapshots(ClusterName parent) {
+ ListSnapshotsRequest request =
+ ListSnapshotsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listSnapshots(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all snapshots associated with the specified cluster.
+ *
+ * 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);
+ * }
+ * }
+ *
+ *
+ * @param 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/-`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSnapshotsPagedResponse listSnapshots(String parent) {
+ ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder().setParent(parent).build();
+ return listSnapshots(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all snapshots associated with the specified cluster.
+ *
+ * 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);
+ * }
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest request) {
+ return listSnapshotsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all snapshots associated with the specified cluster.
+ *
+ * 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
+ listSnapshotsPagedCallable() {
+ return stub.listSnapshotsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all snapshots associated with the specified cluster.
+ *
+ * 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 UnaryCallable listSnapshotsCallable() {
+ return stub.listSnapshotsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes the specified snapshot.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param name The unique name of the snapshot to be deleted. Values are of the form
+ * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteSnapshot(SnapshotName name) {
+
+ DeleteSnapshotRequest request =
+ DeleteSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteSnapshot(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes the specified snapshot.
+ *
+ * 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());
+ * }
+ *
+ *
+ * @param name The unique name of the snapshot to be deleted. Values are of the form
+ * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteSnapshot(String name) {
+
+ DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder().setName(name).build();
+ deleteSnapshot(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes the specified snapshot.
+ *
+ * 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);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final void deleteSnapshot(DeleteSnapshotRequest request) {
+ deleteSnapshotCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes the specified snapshot.
+ *
+ * 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 UnaryCallable deleteSnapshotCallable() {
+ return stub.deleteSnapshotCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+
+ public static class ListTablesPagedResponse
+ extends AbstractPagedListResponse<
+ ListTablesRequest, ListTablesResponse, Table, ListTablesPage,
+ ListTablesFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListTablesPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ new ApiFunction() {
+ @Override
+ public ListTablesPagedResponse apply(ListTablesPage input) {
+ return new ListTablesPagedResponse(input);
+ }
+ });
+ }
+
+ private ListTablesPagedResponse(ListTablesPage page) {
+ super(page, ListTablesFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListTablesPage
+ extends AbstractPage {
+
+ private ListTablesPage(
+ PageContext context,
+ ListTablesResponse response) {
+ super(context, response);
+ }
+
+ private static ListTablesPage createEmptyPage() {
+ return new ListTablesPage(null, null);
+ }
+
+ @Override
+ protected ListTablesPage createPage(
+ PageContext context,
+ ListTablesResponse response) {
+ return new ListTablesPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListTablesFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListTablesRequest, ListTablesResponse, Table, ListTablesPage,
+ ListTablesFixedSizeCollection> {
+
+ private ListTablesFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListTablesFixedSizeCollection createEmptyCollection() {
+ return new ListTablesFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListTablesFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListTablesFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
+ public static class ListSnapshotsPagedResponse
+ extends AbstractPagedListResponse<
+ ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage,
+ ListSnapshotsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ new ApiFunction() {
+ @Override
+ public ListSnapshotsPagedResponse apply(ListSnapshotsPage input) {
+ return new ListSnapshotsPagedResponse(input);
+ }
+ });
+ }
+
+ private ListSnapshotsPagedResponse(ListSnapshotsPage page) {
+ super(page, ListSnapshotsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListSnapshotsPage
+ extends AbstractPage<
+ ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage> {
+
+ private ListSnapshotsPage(
+ PageContext context,
+ ListSnapshotsResponse response) {
+ super(context, response);
+ }
+
+ private static ListSnapshotsPage createEmptyPage() {
+ return new ListSnapshotsPage(null, null);
+ }
+
+ @Override
+ protected ListSnapshotsPage createPage(
+ PageContext context,
+ ListSnapshotsResponse response) {
+ return new ListSnapshotsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListSnapshotsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage,
+ ListSnapshotsFixedSizeCollection> {
+
+ private ListSnapshotsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListSnapshotsFixedSizeCollection createEmptyCollection() {
+ return new ListSnapshotsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListSnapshotsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListSnapshotsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+}
diff --git a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java
new file mode 100644
index 000000000000..b11f94ff4c26
--- /dev/null
+++ b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java
@@ -0,0 +1,371 @@
+/*
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.bigtable.admin.v2;
+
+import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSnapshotsPagedResponse;
+import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.bigtable.admin.v2.CheckConsistencyRequest;
+import com.google.bigtable.admin.v2.CheckConsistencyResponse;
+import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata;
+import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest;
+import com.google.bigtable.admin.v2.CreateTableRequest;
+import com.google.bigtable.admin.v2.DeleteSnapshotRequest;
+import com.google.bigtable.admin.v2.DeleteTableRequest;
+import com.google.bigtable.admin.v2.DropRowRangeRequest;
+import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest;
+import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse;
+import com.google.bigtable.admin.v2.GetSnapshotRequest;
+import com.google.bigtable.admin.v2.GetTableRequest;
+import com.google.bigtable.admin.v2.ListSnapshotsRequest;
+import com.google.bigtable.admin.v2.ListSnapshotsResponse;
+import com.google.bigtable.admin.v2.ListTablesRequest;
+import com.google.bigtable.admin.v2.ListTablesResponse;
+import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest;
+import com.google.bigtable.admin.v2.Snapshot;
+import com.google.bigtable.admin.v2.SnapshotTableMetadata;
+import com.google.bigtable.admin.v2.SnapshotTableRequest;
+import com.google.bigtable.admin.v2.Table;
+import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Settings class to configure an instance of {@link BaseBigtableTableAdminClient}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (bigtableadmin.googleapis.com) and default port (443) are used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * 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. For
+ * example, to set the total timeout of createTable to 30 seconds:
+ *
+ *
+ *
+ * BaseBigtableTableAdminSettings.Builder baseBigtableTableAdminSettingsBuilder =
+ * BaseBigtableTableAdminSettings.newBuilder();
+ * baseBigtableTableAdminSettingsBuilder.createTableSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30));
+ * BaseBigtableTableAdminSettings baseBigtableTableAdminSettings = baseBigtableTableAdminSettingsBuilder.build();
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class BaseBigtableTableAdminSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to createTable. */
+ public UnaryCallSettings createTableSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).createTableSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createTableFromSnapshot. */
+ public UnaryCallSettings
+ createTableFromSnapshotSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).createTableFromSnapshotSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createTableFromSnapshot. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings<
+ CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata>
+ createTableFromSnapshotOperationSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings())
+ .createTableFromSnapshotOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listTables. */
+ public PagedCallSettings
+ listTablesSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).listTablesSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getTable. */
+ public UnaryCallSettings getTableSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).getTableSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteTable. */
+ public UnaryCallSettings deleteTableSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).deleteTableSettings();
+ }
+
+ /** Returns the object with the settings used for calls to modifyColumnFamilies. */
+ public UnaryCallSettings modifyColumnFamiliesSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).modifyColumnFamiliesSettings();
+ }
+
+ /** Returns the object with the settings used for calls to dropRowRange. */
+ public UnaryCallSettings dropRowRangeSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).dropRowRangeSettings();
+ }
+
+ /** Returns the object with the settings used for calls to generateConsistencyToken. */
+ public UnaryCallSettings
+ generateConsistencyTokenSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).generateConsistencyTokenSettings();
+ }
+
+ /** Returns the object with the settings used for calls to checkConsistency. */
+ public UnaryCallSettings
+ checkConsistencySettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).checkConsistencySettings();
+ }
+
+ /** Returns the object with the settings used for calls to snapshotTable. */
+ public UnaryCallSettings snapshotTableSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).snapshotTableSettings();
+ }
+
+ /** Returns the object with the settings used for calls to snapshotTable. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings
+ snapshotTableOperationSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).snapshotTableOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getSnapshot. */
+ public UnaryCallSettings getSnapshotSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).getSnapshotSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listSnapshots. */
+ public PagedCallSettings
+ listSnapshotsSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).listSnapshotsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteSnapshot. */
+ public UnaryCallSettings deleteSnapshotSettings() {
+ return ((BigtableTableAdminStubSettings) getStubSettings()).deleteSnapshotSettings();
+ }
+
+ public static final BaseBigtableTableAdminSettings create(BigtableTableAdminStubSettings stub)
+ throws IOException {
+ return new BaseBigtableTableAdminSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return BigtableTableAdminStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return BigtableTableAdminStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return BigtableTableAdminStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return BigtableTableAdminStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return BigtableTableAdminStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return BigtableTableAdminStubSettings.defaultTransportChannelProvider();
+ }
+
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return BigtableTableAdminStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder(ClientContext clientContext) {
+ return new Builder(clientContext);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected BaseBigtableTableAdminSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for BaseBigtableTableAdminSettings. */
+ public static class Builder
+ extends ClientSettings.Builder {
+ protected Builder() throws IOException {
+ this((ClientContext) null);
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(BigtableTableAdminStubSettings.newBuilder(clientContext));
+ }
+
+ private static Builder createDefault() {
+ return new Builder(BigtableTableAdminStubSettings.newBuilder());
+ }
+
+ protected Builder(BaseBigtableTableAdminSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(BigtableTableAdminStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ public BigtableTableAdminStubSettings.Builder getStubSettingsBuilder() {
+ return ((BigtableTableAdminStubSettings.Builder) getStubSettings());
+ }
+
+ // NEXT_MAJOR_VER: remove 'throws Exception'
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) throws Exception {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to createTable. */
+ public UnaryCallSettings.Builder createTableSettings() {
+ return getStubSettingsBuilder().createTableSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createTableFromSnapshot. */
+ public UnaryCallSettings.Builder
+ createTableFromSnapshotSettings() {
+ return getStubSettingsBuilder().createTableFromSnapshotSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createTableFromSnapshot. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder<
+ CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata>
+ createTableFromSnapshotOperationSettings() {
+ return getStubSettingsBuilder().createTableFromSnapshotOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listTables. */
+ public PagedCallSettings.Builder
+ listTablesSettings() {
+ return getStubSettingsBuilder().listTablesSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getTable. */
+ public UnaryCallSettings.Builder getTableSettings() {
+ return getStubSettingsBuilder().getTableSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteTable. */
+ public UnaryCallSettings.Builder deleteTableSettings() {
+ return getStubSettingsBuilder().deleteTableSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to modifyColumnFamilies. */
+ public UnaryCallSettings.Builder
+ modifyColumnFamiliesSettings() {
+ return getStubSettingsBuilder().modifyColumnFamiliesSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to dropRowRange. */
+ public UnaryCallSettings.Builder dropRowRangeSettings() {
+ return getStubSettingsBuilder().dropRowRangeSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to generateConsistencyToken. */
+ public UnaryCallSettings.Builder<
+ GenerateConsistencyTokenRequest, GenerateConsistencyTokenResponse>
+ generateConsistencyTokenSettings() {
+ return getStubSettingsBuilder().generateConsistencyTokenSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to checkConsistency. */
+ public UnaryCallSettings.Builder
+ checkConsistencySettings() {
+ return getStubSettingsBuilder().checkConsistencySettings();
+ }
+
+ /** Returns the builder for the settings used for calls to snapshotTable. */
+ public UnaryCallSettings.Builder snapshotTableSettings() {
+ return getStubSettingsBuilder().snapshotTableSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to snapshotTable. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ snapshotTableOperationSettings() {
+ return getStubSettingsBuilder().snapshotTableOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getSnapshot. */
+ public UnaryCallSettings.Builder getSnapshotSettings() {
+ return getStubSettingsBuilder().getSnapshotSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listSnapshots. */
+ public PagedCallSettings.Builder<
+ ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse>
+ listSnapshotsSettings() {
+ return getStubSettingsBuilder().listSnapshotsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteSnapshot. */
+ public UnaryCallSettings.Builder deleteSnapshotSettings() {
+ return getStubSettingsBuilder().deleteSnapshotSettings();
+ }
+
+ @Override
+ public BaseBigtableTableAdminSettings build() throws IOException {
+ return new BaseBigtableTableAdminSettings(this);
+ }
+ }
+}
diff --git a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java
index 79e8e7d0bdd1..c6e2ecc38847 100644
--- a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java
+++ b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java
@@ -15,1966 +15,685 @@
*/
package com.google.cloud.bigtable.admin.v2;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
-import com.google.api.core.BetaApi;
-import com.google.api.gax.core.BackgroundResource;
-import com.google.api.gax.longrunning.OperationFuture;
-import com.google.api.gax.paging.AbstractFixedSizeCollection;
-import com.google.api.gax.paging.AbstractPage;
-import com.google.api.gax.paging.AbstractPagedListResponse;
-import com.google.api.gax.rpc.OperationCallable;
-import com.google.api.gax.rpc.PageContext;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.bigtable.admin.v2.CheckConsistencyRequest;
import com.google.bigtable.admin.v2.CheckConsistencyResponse;
-import com.google.bigtable.admin.v2.ClusterName;
-import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata;
-import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest;
-import com.google.bigtable.admin.v2.CreateTableRequest;
-import com.google.bigtable.admin.v2.DeleteSnapshotRequest;
import com.google.bigtable.admin.v2.DeleteTableRequest;
import com.google.bigtable.admin.v2.DropRowRangeRequest;
+import com.google.bigtable.admin.v2.DropRowRangeRequest.Builder;
import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest;
import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse;
-import com.google.bigtable.admin.v2.GetSnapshotRequest;
import com.google.bigtable.admin.v2.GetTableRequest;
import com.google.bigtable.admin.v2.InstanceName;
-import com.google.bigtable.admin.v2.ListSnapshotsRequest;
-import com.google.bigtable.admin.v2.ListSnapshotsResponse;
import com.google.bigtable.admin.v2.ListTablesRequest;
import com.google.bigtable.admin.v2.ListTablesResponse;
import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest;
-import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification;
-import com.google.bigtable.admin.v2.Snapshot;
-import com.google.bigtable.admin.v2.SnapshotName;
-import com.google.bigtable.admin.v2.SnapshotTableMetadata;
-import com.google.bigtable.admin.v2.SnapshotTableRequest;
-import com.google.bigtable.admin.v2.Table;
import com.google.bigtable.admin.v2.TableName;
+import com.google.cloud.bigtable.admin.v2.models.TableAdminRequests.CreateTable;
+import com.google.cloud.bigtable.admin.v2.models.TableAdminRequests.ModifyFamilies;
+import com.google.cloud.bigtable.admin.v2.models.TableAdminResponses;
+import com.google.cloud.bigtable.admin.v2.models.TableAdminResponses.ConsistencyToken;
+import com.google.cloud.bigtable.admin.v2.models.TableAdminResponses.Table;
import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStub;
-import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings;
-import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
+import com.google.protobuf.ByteString;
import com.google.protobuf.Empty;
-import java.io.IOException;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import javax.annotation.Generated;
+import javax.annotation.Nonnull;
-// AUTO-GENERATED DOCUMENTATION AND SERVICE
/**
- * Service Description: Service for creating, configuring, and deleting Cloud Bigtable tables.
+ * Client for creating, configuring, and deleting Cloud Bigtable tables
*
* 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * String tableId = "";
- * Table table = Table.newBuilder().build();
- * Table response = bigtableTableAdminClient.createTable(parent, tableId, table);
- * }
- *
- *
- *
- * Note: close() needs to be called on the bigtableTableAdminClient 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.
*
- *
- * - A "flattened" method. With this type of method, the fields of the request type have been
- * converted into function parameters. It may be the case that not all fields are available as
- * parameters, and not every API method will have a flattened method entry point.
- *
- A "request object" method. This type of method only takes one parameter, a request object,
- * which must be constructed before the call. Not every API method will have a request object
- * method.
- *
- A "callable" method. This type of method takes no parameters and returns an immutable API
- * callable object, which can be used to initiate calls to the service.
- *
+ * Sample code to get started:
*
- *
See the individual methods for example code.
+ *
{@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * CreateTable createTableReq =
+ * TableAdminRequests.createTable("tableId")
+ * .addFamily("cf1")
+ * .addFamily("cf2", GCRULES.maxVersions(10))
+ * .addSplit(ByteString.copyFromUtf8("b"))
+ * .addSplit(ByteString.copyFromUtf8("q"));
+ * client.createTable(createTableReq);
+ * }
+ * }
*
- * 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.
+ *
Note: close() needs to be called on the client object to clean up resources such as threads.
+ * In the example above, try-with-resources is used, which automatically calls close().
*
*
This class can be customized by passing in a custom instance of BigtableTableAdminSettings to
* create(). For example:
*
*
To customize credentials:
*
- *
- *
- * BigtableTableAdminSettings bigtableTableAdminSettings =
- * BigtableTableAdminSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * BigtableTableAdminClient bigtableTableAdminClient =
- * BigtableTableAdminClient.create(bigtableTableAdminSettings);
- *
- *
+ * {@code
+ * BigtableTableAdminSettings tableAdminSettings = BigtableTableAdminSettings.newBuilder()
+ * .setInstanceName(InstanceName.of("[PROJECT]", "[INSTANCE]"))
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ *
+ * BigtableTableAdminClient client =
+ * BigtableTableAdminClient.create(tableAdminSettings);
+ * }
*
* To customize the endpoint:
*
- *
- *
- * BigtableTableAdminSettings bigtableTableAdminSettings =
- * BigtableTableAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
- * BigtableTableAdminClient bigtableTableAdminClient =
- * BigtableTableAdminClient.create(bigtableTableAdminSettings);
- *
- *
+ * {@code
+ * BigtableTableAdminSettings tableAdminSettings = BigtableTableAdminSettings.newBuilder()
+ * .setInstanceName(InstanceName.of("[PROJECT]", "[INSTANCE]"))
+ * .setEndpoint(myEndpoint).build();
+ *
+ * BigtableTableAdminClient client = BigtableTableAdminClient.create(tableAdminSettings);
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
-public class BigtableTableAdminClient implements BackgroundResource {
- private final BigtableTableAdminSettings settings;
+public class BigtableTableAdminClient implements AutoCloseable {
private final BigtableTableAdminStub stub;
- private final OperationsClient operationsClient;
-
- /** Constructs an instance of BigtableTableAdminClient with default settings. */
- public static final BigtableTableAdminClient create() throws IOException {
- return create(BigtableTableAdminSettings.newBuilder().build());
- }
+ private final InstanceName instanceName;
- /**
- * Constructs an instance of BigtableTableAdminClient, using the given settings. The channels are
- * created based on the settings passed in, or defaults for any settings that are not set.
- */
- public static final BigtableTableAdminClient create(BigtableTableAdminSettings settings)
- throws IOException {
- return new BigtableTableAdminClient(settings);
+ /** Constructs an instance of BigtableTableAdminClient with the given instanceName. */
+ public static BigtableTableAdminClient create(@Nonnull InstanceName instanceName) throws IOException {
+ return create(BigtableTableAdminSettings.newBuilder().setInstanceName(instanceName).build());
}
- /**
- * Constructs an instance of BigtableTableAdminClient, using the given stub for making calls. This
- * is for advanced usage - prefer to use BigtableTableAdminSettings}.
- */
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final BigtableTableAdminClient create(BigtableTableAdminStub stub) {
- return new BigtableTableAdminClient(stub);
+ /** Constructs an instance of BigtableTableAdminClient with the given settings. */
+ public static BigtableTableAdminClient create(@Nonnull BigtableTableAdminSettings settings) throws IOException {
+ return create(settings.getInstanceName(), settings.getStubSettings().createStub());
}
- /**
- * Constructs an instance of BigtableTableAdminClient, using the given settings. This is protected
- * so that it is easy to make a subclass, but otherwise, the static factory methods should be
- * preferred.
- */
- protected BigtableTableAdminClient(BigtableTableAdminSettings settings) throws IOException {
- this.settings = settings;
- this.stub = ((BigtableTableAdminStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ /** Constructs an instance of BigtableTableAdminClient with the given instanceName and stub. */
+ public static BigtableTableAdminClient create(@Nonnull InstanceName instanceName, @Nonnull BigtableTableAdminStub stub) {
+ return new BigtableTableAdminClient(instanceName, stub);
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected BigtableTableAdminClient(BigtableTableAdminStub stub) {
- this.settings = null;
+ private BigtableTableAdminClient(@Nonnull InstanceName instanceName, @Nonnull BigtableTableAdminStub stub) {
+ Preconditions.checkNotNull(instanceName);
+ Preconditions.checkNotNull(stub);
+ this.instanceName = instanceName;
this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- public final BigtableTableAdminSettings getSettings() {
- return settings;
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public BigtableTableAdminStub getStub() {
- return stub;
- }
-
- /**
- * Returns the OperationsClient that can be used to query the status of a long-running operation
- * returned by another API method call.
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationsClient getOperationsClient() {
- return operationsClient;
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table in the specified instance. The table can be created with a full set of
- * initial column families, specified in the request.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * String tableId = "";
- * Table table = Table.newBuilder().build();
- * Table response = bigtableTableAdminClient.createTable(parent, tableId, table);
- * }
- *
- *
- * @param parent The unique name of the instance in which to create the table. Values are of the
- * form `projects/<project>/instances/<instance>`.
- * @param tableId The name by which the new table should be referred to within the parent
- * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
- * @param table The Table to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Table createTable(InstanceName parent, String tableId, Table table) {
-
- CreateTableRequest request =
- CreateTableRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .setTableId(tableId)
- .setTable(table)
- .build();
- return createTable(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table in the specified instance. The table can be created with a full set of
- * initial column families, specified in the request.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * String tableId = "";
- * Table table = Table.newBuilder().build();
- * Table response = bigtableTableAdminClient.createTable(parent.toString(), tableId, table);
- * }
- *
- *
- * @param parent The unique name of the instance in which to create the table. Values are of the
- * form `projects/<project>/instances/<instance>`.
- * @param tableId The name by which the new table should be referred to within the parent
- * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
- * @param table The Table to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Table createTable(String parent, String tableId, Table table) {
-
- CreateTableRequest request =
- CreateTableRequest.newBuilder()
- .setParent(parent)
- .setTableId(tableId)
- .setTable(table)
- .build();
- return createTable(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table in the specified instance. The table can be created with a full set of
- * initial column families, specified in the request.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.createTable(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Table createTable(CreateTableRequest request) {
- return createTableCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table in the specified instance. The table can be created with a full set of
- * initial column families, specified in the request.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.createTableCallable().futureCall(request);
- * // Do something
- * Table response = future.get();
- * }
- *
- */
- public final UnaryCallable createTableCallable() {
- return stub.createTableCallable();
+ /** Gets the instanceName this client is associated with. */
+ public InstanceName getInstanceName() {
+ return instanceName;
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * String tableId = "";
- * SnapshotName sourceSnapshot = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * Table response = bigtableTableAdminClient.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get();
- * }
- *
- *
- * @param parent The unique name of the instance in which to create the table. Values are of the
- * form `projects/<project>/instances/<instance>`.
- * @param tableId The name by which the new table should be referred to within the parent
- * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
- * @param 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>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture createTableFromSnapshotAsync(
- InstanceName parent, String tableId, SnapshotName sourceSnapshot) {
-
- CreateTableFromSnapshotRequest request =
- CreateTableFromSnapshotRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .setTableId(tableId)
- .setSourceSnapshot(sourceSnapshot == null ? null : sourceSnapshot.toString())
- .build();
- return createTableFromSnapshotAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * String tableId = "";
- * SnapshotName sourceSnapshot = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * Table response = bigtableTableAdminClient.createTableFromSnapshotAsync(parent.toString(), tableId, sourceSnapshot.toString()).get();
- * }
- *
- *
- * @param parent The unique name of the instance in which to create the table. Values are of the
- * form `projects/<project>/instances/<instance>`.
- * @param tableId The name by which the new table should be referred to within the parent
- * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
- * @param 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>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture createTableFromSnapshotAsync(
- String parent, String tableId, String sourceSnapshot) {
-
- CreateTableFromSnapshotRequest request =
- CreateTableFromSnapshotRequest.newBuilder()
- .setParent(parent)
- .setTableId(tableId)
- .setSourceSnapshot(sourceSnapshot)
- .build();
- return createTableFromSnapshotAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.createTableFromSnapshotAsync(request).get();
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture createTableFromSnapshotAsync(
- CreateTableFromSnapshotRequest request) {
- return createTableFromSnapshotOperationCallable().futureCall(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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<Operation> future = bigtableTableAdminClient.createTableFromSnapshotOperationCallable().futureCall(request);
- * // Do something
- * Table response = future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable<
- CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata>
- createTableFromSnapshotOperationCallable() {
- return stub.createTableFromSnapshotOperationCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.createTableFromSnapshotCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- */
- public final UnaryCallable
- createTableFromSnapshotCallable() {
- return stub.createTableFromSnapshotCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all tables served from a specified instance.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * for (Table element : bigtableTableAdminClient.listTables(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @param parent The unique name of the instance for which tables should be listed. Values are of
- * the form `projects/<project>/instances/<instance>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListTablesPagedResponse listTables(InstanceName parent) {
- ListTablesRequest request =
- ListTablesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
- return listTables(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all tables served from a specified instance.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * for (Table element : bigtableTableAdminClient.listTables(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @param parent The unique name of the instance for which tables should be listed. Values are of
- * the form `projects/<project>/instances/<instance>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListTablesPagedResponse listTables(String parent) {
- ListTablesRequest request = ListTablesRequest.newBuilder().setParent(parent).build();
- return listTables(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all tables served from a specified instance.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * ListTablesRequest request = ListTablesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Table element : bigtableTableAdminClient.listTables(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListTablesPagedResponse listTables(ListTablesRequest request) {
- return listTablesPagedCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all tables served from a specified instance.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * ListTablesRequest request = ListTablesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListTablesPagedResponse> future = bigtableTableAdminClient.listTablesPagedCallable().futureCall(request);
- * // Do something
- * for (Table element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable listTablesPagedCallable() {
- return stub.listTablesPagedCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all tables served from a specified instance.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
- * ListTablesRequest request = ListTablesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListTablesResponse response = bigtableTableAdminClient.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 UnaryCallable listTablesCallable() {
- return stub.listTablesCallable();
+ @Override
+ public void close() {
+ stub.close();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets metadata information about the specified table.
+ * Creates a new table with the specified configuration
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * Table response = bigtableTableAdminClient.getTable(name);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * CreateTable createTableReq =
+ * TableAdminRequests.createTable("tableId")
+ * .addFamily("cf2", GCRULES.maxVersions(10))
+ * client.createTable(createTableReq);
* }
- *
+ * }
*
- * @param name The unique name of the requested table. Values are of the form
- * `projects/<project>/instances/<instance>/tables/<table>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param createTable
+ * @return the newly created table
+ * @see CreateTable for createTable configurations
*/
- public final Table getTable(TableName name) {
-
- GetTableRequest request =
- GetTableRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- return getTable(request);
+ public Table createTable(CreateTable createTable) {
+ com.google.bigtable.admin.v2.Table table =
+ this.stub.createTableCallable().call(createTable.toProto(instanceName));
+ return TableAdminResponses.convertTable(table);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets metadata information about the specified table.
+ * Creates a new table with the specified configuration asynchronously
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * Table response = bigtableTableAdminClient.getTable(name.toString());
- * }
- *
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * CreateTable createTableReq =
+ * TableAdminRequests.createTable("tableId")
+ * .addFamily("cf2", GCRULES.maxVersions(10))
+ * client.createTableAsync(createTableReq);
+ * }
+ * }
*
- * @param name The unique name of the requested table. Values are of the form
- * `projects/<project>/instances/<instance>/tables/<table>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param createTable
+ * @return the newly created table
+ * @see CreateTable for createTable configurations
*/
- public final Table getTable(String name) {
-
- GetTableRequest request = GetTableRequest.newBuilder().setName(name).build();
- return getTable(request);
+ public ApiFuture createTableAsync(CreateTable createTable) {
+ return transformToTableResponse(
+ this.stub.createTableCallable().futureCall(createTable.toProto(instanceName)));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets metadata information about the specified table.
+ * Creates, Updates and drops ColumnFamilies as per the request.
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * GetTableRequest request = GetTableRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Table response = bigtableTableAdminClient.getTable(request);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * ModifyFamilies modifyFamiliesReq = TableAdminRequests.modifyFamilies(tableId)
+ * .addFamily("mf1")
+ * .addFamily(
+ * "mf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000)))
+ * .updateFamily(
+ * "mf1",
+ * GCRULES
+ * .union()
+ * .rule(GCRULES.maxAge(Duration.ofSeconds(100)))
+ * .rule(GCRULES.maxVersions(1)))
+ * .addFamily(
+ * "mf3",
+ * GCRULES
+ * .intersection()
+ * .rule(GCRULES.maxAge(Duration.ofSeconds(2000)))
+ * .rule(GCRULES.maxVersions(10)))
+ * .dropFamily("mf1")
+ * client.modifyFamilies(modifyFamiliesReq);
* }
- *
+ * }
*
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Table getTable(GetTableRequest request) {
- return getTableCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets metadata information about the specified table.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * GetTableRequest request = GetTableRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Table> future = bigtableTableAdminClient.getTableCallable().futureCall(request);
- * // Do something
- * Table response = future.get();
- * }
- *
+ * @param modifyFamily
+ * @return the modified table
+ * @see ModifyFamilies for modifyFamily options
*/
- public final UnaryCallable getTableCallable() {
- return stub.getTableCallable();
+ public Table modifyFamilies(ModifyFamilies modifyFamily) {
+ ModifyColumnFamiliesRequest modReq = modifyFamily.toProto(instanceName);
+ com.google.bigtable.admin.v2.Table table =
+ this.stub.modifyColumnFamiliesCallable().call(modReq);
+ return TableAdminResponses.convertTable(table);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently deletes a specified table and all of its data.
+ * Creates, Updates and drops ColumnFamilies as per the request asynchronously
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * bigtableTableAdminClient.deleteTable(name);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * ModifyFamilies modifyFamiliesReq = TableAdminRequests.modifyFamilies(tableId)
+ * .addFamily("mf1")
+ * .addFamily(
+ * "mf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000)))
+ * .updateFamily(
+ * "mf1",
+ * GCRULES
+ * .union()
+ * .rule(GCRULES.maxAge(Duration.ofSeconds(100)))
+ * .rule(GCRULES.maxVersions(1)))
+ * .addFamily(
+ * "mf3",
+ * GCRULES
+ * .intersection()
+ * .rule(GCRULES.maxAge(Duration.ofSeconds(2000)))
+ * .rule(GCRULES.maxVersions(10)))
+ * .dropFamily("mf1")
+ * client.modifyFamilies(modifyFamiliesReq);
* }
- *
+ * }
*
- * @param name The unique name of the table to be deleted. Values are of the form
- * `projects/<project>/instances/<instance>/tables/<table>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param modifyFamily
+ * @return Modified table
+ * @see ModifyFamilies for modifyFamily options
*/
- public final void deleteTable(TableName name) {
-
- DeleteTableRequest request =
- DeleteTableRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteTable(request);
+ public ApiFuture modifyFamiliesAsync(ModifyFamilies modifyFamily) {
+ ModifyColumnFamiliesRequest modReq = modifyFamily.toProto(instanceName);
+ return transformToTableResponse(this.stub.modifyColumnFamiliesCallable().futureCall(modReq));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently deletes a specified table and all of its data.
+ * Deletes the specified tableId
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * bigtableTableAdminClient.deleteTable(name.toString());
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.deleteTable("tableId");
* }
- *
+ * }
*
- * @param name The unique name of the table to be deleted. Values are of the form
- * `projects/<project>/instances/<instance>/tables/<table>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- public final void deleteTable(String name) {
-
- DeleteTableRequest request = DeleteTableRequest.newBuilder().setName(name).build();
- deleteTable(request);
+ public void deleteTable(String tableId) {
+ this.stub.deleteTableCallable().call(composeDeleteTableRequest(tableId));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently deletes a specified table and all of its data.
+ * Deletes the specified tableId asynchronously
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * DeleteTableRequest request = DeleteTableRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * bigtableTableAdminClient.deleteTable(request);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.deleteTableAsync("tableId");
* }
- *
+ * }
*
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- private final void deleteTable(DeleteTableRequest request) {
- deleteTableCallable().call(request);
+ public ApiFuture deleteTableAsync(String tableId) {
+ return transformToVoid(
+ this.stub.deleteTableCallable().futureCall(composeDeleteTableRequest(tableId)));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently deletes a specified table and all of its data.
+ * Gets the Table by tableId
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * DeleteTableRequest request = DeleteTableRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = bigtableTableAdminClient.deleteTableCallable().futureCall(request);
- * // Do something
- * future.get();
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.getTable("tableId");
* }
- *
- */
- public final UnaryCallable deleteTableCallable() {
- return stub.deleteTableCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Performs a series of column family modifications on the specified table. Either all or none of
- * the modifications will occur before this method returns, but data requests received prior to
- * that point may see a table where only some modifications have taken effect.
+ * }
*
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
- * Table response = bigtableTableAdminClient.modifyColumnFamilies(name, modifications);
- * }
- *
- *
- * @param name The unique name of the table whose families should be modified. Values are of the
- * form `projects/<project>/instances/<instance>/tables/<table>`.
- * @param 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).
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- public final Table modifyColumnFamilies(
- TableName name, List modifications) {
-
- ModifyColumnFamiliesRequest request =
- ModifyColumnFamiliesRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .addAllModifications(modifications)
- .build();
- return modifyColumnFamilies(request);
+ public Table getTable(String tableId) {
+ com.google.bigtable.admin.v2.Table table =
+ this.stub.getTableCallable().call(composeGetTableRequest(tableId));
+ return TableAdminResponses.convertTable(table);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Performs a series of column family modifications on the specified table. Either all or none of
- * the modifications will occur before this method returns, but data requests received prior to
- * that point may see a table where only some modifications have taken effect.
+ * Gets the Table by tableId
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
- * Table response = bigtableTableAdminClient.modifyColumnFamilies(name.toString(), modifications);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.getTableAsync("tableId");
* }
- *
- *
- * @param name The unique name of the table whose families should be modified. Values are of the
- * form `projects/<project>/instances/<instance>/tables/<table>`.
- * @param 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).
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Table modifyColumnFamilies(
- String name, List modifications) {
-
- ModifyColumnFamiliesRequest request =
- ModifyColumnFamiliesRequest.newBuilder()
- .setName(name)
- .addAllModifications(modifications)
- .build();
- return modifyColumnFamilies(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Performs a series of column family modifications on the specified table. Either all or none of
- * the modifications will occur before this method returns, but data requests received prior to
- * that point may see a table where only some modifications have taken effect.
+ * }
*
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.modifyColumnFamilies(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- public final Table modifyColumnFamilies(ModifyColumnFamiliesRequest request) {
- return modifyColumnFamiliesCallable().call(request);
+ public ApiFuture getTableAsync(String tableId) {
+ return transformToTableResponse(
+ this.stub.getTableCallable().futureCall(composeGetTableRequest(tableId)));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Performs a series of column family modifications on the specified table. Either all or none of
- * the modifications will occur before this method returns, but data requests received prior to
- * that point may see a table where only some modifications have taken effect.
+ * Lists all TableNames in the instance.
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.modifyColumnFamiliesCallable().futureCall(request);
- * // Do something
- * Table response = future.get();
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.listTables();
* }
- *
+ * }
*/
- public final UnaryCallable modifyColumnFamiliesCallable() {
- return stub.modifyColumnFamiliesCallable();
+ public List listTables() {
+ ListTablesResponse listResp = this.stub.listTablesCallable().call(composeListTableRequest());
+ return convertToTableNames(listResp);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently drop/delete a row range from a specified table. The request can specify whether to
- * delete all rows in a table, or only those that match a particular prefix.
+ * Lists all TableNames in the instance asynchronously
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * DropRowRangeRequest request = DropRowRangeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * bigtableTableAdminClient.dropRowRange(request);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.listTablesAsync();
* }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * }
*/
- public final void dropRowRange(DropRowRangeRequest request) {
- dropRowRangeCallable().call(request);
- }
+ public ApiFuture> listTablesAsync() {
+ ApiFuture listResp =
+ this.stub.listTablesCallable().futureCall(composeListTableRequest());
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Permanently drop/delete a row range from a specified table. The request can specify whether to
- * delete all rows in a table, or only those that match a particular prefix.
- *
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * DropRowRangeRequest request = DropRowRangeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = bigtableTableAdminClient.dropRowRangeCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable dropRowRangeCallable() {
- return stub.dropRowRangeCallable();
+ return ApiFutures.transform(
+ listResp,
+ new ApiFunction>() {
+ @Override
+ public List apply(ListTablesResponse input) {
+ return convertToTableNames(input);
+ }
+ });
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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. The
- * tokens will be available for 90 days.
+ * Drops rows by the specified key prefix and tableId
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * GenerateConsistencyTokenResponse response = bigtableTableAdminClient.generateConsistencyToken(name);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.dropRowRange("tableId");
* }
- *
+ * }
*
- * @param 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>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
+ * @param rowKeyPrefix
*/
- public final GenerateConsistencyTokenResponse generateConsistencyToken(TableName name) {
-
- GenerateConsistencyTokenRequest request =
- GenerateConsistencyTokenRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .build();
- return generateConsistencyToken(request);
+ public void dropRowRange(String tableId, String rowKeyPrefix) {
+ dropRowRange(tableId, ByteString.copyFromUtf8(rowKeyPrefix));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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. The
- * tokens will be available for 90 days.
+ * Drops rows by the specified key prefix and tableId asynchronously
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * GenerateConsistencyTokenResponse response = bigtableTableAdminClient.generateConsistencyToken(name.toString());
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.dropRowRangeAsync("tableId");
* }
- *
+ * }
*
- * @param 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>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
+ * @param rowKeyPrefix
*/
- public final GenerateConsistencyTokenResponse generateConsistencyToken(String name) {
-
- GenerateConsistencyTokenRequest request =
- GenerateConsistencyTokenRequest.newBuilder().setName(name).build();
- return generateConsistencyToken(request);
+ public ApiFuture dropRowRangeAsync(String tableId, String rowKeyPrefix) {
+ return dropRowRangeAsync(tableId, ByteString.copyFromUtf8(rowKeyPrefix));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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. The
- * tokens will be available for 90 days.
+ * Drops rows by the specified key prefix and tableId
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * GenerateConsistencyTokenRequest request = GenerateConsistencyTokenRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * GenerateConsistencyTokenResponse response = bigtableTableAdminClient.generateConsistencyToken(request);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.dropRowRange("tableId");
* }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- private final GenerateConsistencyTokenResponse generateConsistencyToken(
- GenerateConsistencyTokenRequest request) {
- return generateConsistencyTokenCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * 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. The
- * tokens will be available for 90 days.
- *
- * Sample code:
+ * }
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * GenerateConsistencyTokenRequest request = GenerateConsistencyTokenRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<GenerateConsistencyTokenResponse> future = bigtableTableAdminClient.generateConsistencyTokenCallable().futureCall(request);
- * // Do something
- * GenerateConsistencyTokenResponse response = future.get();
- * }
- *
+ * @param tableId
+ * @param rowKeyPrefix
*/
- public final UnaryCallable
- generateConsistencyTokenCallable() {
- return stub.generateConsistencyTokenCallable();
+ public void dropRowRange(String tableId, ByteString rowKeyPrefix) {
+ this.stub.dropRowRangeCallable().call(composeDropRowRangeRequest(tableId, rowKeyPrefix, false));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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.
+ * Drops rows by the specified key prefix and tableId
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * String consistencyToken = "";
- * CheckConsistencyResponse response = bigtableTableAdminClient.checkConsistency(name, consistencyToken);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.dropRowRangeAsync("tableId");
* }
- *
+ * }
*
- * @param name The unique name of the Table for which to check replication consistency. Values are
- * of the form `projects/<project>/instances/<instance>/tables/<table>`.
- * @param consistencyToken The token created using GenerateConsistencyToken for the Table.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
+ * @param rowKeyPrefix
*/
- public final CheckConsistencyResponse checkConsistency(TableName name, String consistencyToken) {
-
- CheckConsistencyRequest request =
- CheckConsistencyRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .setConsistencyToken(consistencyToken)
- .build();
- return checkConsistency(request);
+ public ApiFuture dropRowRangeAsync(String tableId, ByteString rowKeyPrefix) {
+ return transformToVoid(
+ this.stub
+ .dropRowRangeCallable()
+ .futureCall(composeDropRowRangeRequest(tableId, rowKeyPrefix, false)));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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.
+ * Drops all data in the table
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * String consistencyToken = "";
- * CheckConsistencyResponse response = bigtableTableAdminClient.checkConsistency(name.toString(), consistencyToken);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.dropAllRows("tableId");
* }
- *
+ * }
*
- * @param name The unique name of the Table for which to check replication consistency. Values are
- * of the form `projects/<project>/instances/<instance>/tables/<table>`.
- * @param consistencyToken The token created using GenerateConsistencyToken for the Table.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- public final CheckConsistencyResponse checkConsistency(String name, String consistencyToken) {
-
- CheckConsistencyRequest request =
- CheckConsistencyRequest.newBuilder()
- .setName(name)
- .setConsistencyToken(consistencyToken)
- .build();
- return checkConsistency(request);
+ public void dropAllRows(String tableId) {
+ this.stub.dropRowRangeCallable().call(composeDropRowRangeRequest(tableId, null, true));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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.
+ * Drops all data in the table asynchronously
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * String consistencyToken = "";
- * CheckConsistencyRequest request = CheckConsistencyRequest.newBuilder()
- * .setName(name.toString())
- * .setConsistencyToken(consistencyToken)
- * .build();
- * CheckConsistencyResponse response = bigtableTableAdminClient.checkConsistency(request);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * client.dropAllRowsAsync("tableId");
* }
- *
+ * }
*
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- public final CheckConsistencyResponse checkConsistency(CheckConsistencyRequest request) {
- return checkConsistencyCallable().call(request);
+ public ApiFuture dropAllRowsAsync(String tableId) {
+ return transformToVoid(
+ this.stub
+ .dropRowRangeCallable()
+ .futureCall(composeDropRowRangeRequest(tableId, null, true)));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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.
+ * Generates a token to verify the replication status of table mutations invoked before this call.
+ * Token expires in 90 days
*
* Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
- * String consistencyToken = "";
- * CheckConsistencyRequest request = CheckConsistencyRequest.newBuilder()
- * .setName(name.toString())
- * .setConsistencyToken(consistencyToken)
- * .build();
- * ApiFuture<CheckConsistencyResponse> future = bigtableTableAdminClient.checkConsistencyCallable().futureCall(request);
- * // Do something
- * CheckConsistencyResponse response = future.get();
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * ConsistencyToken consistencyToken = client.generateConsistencyToken("tableId");
* }
- *
- */
- public final UnaryCallable
- checkConsistencyCallable() {
- return stub.checkConsistencyCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new snapshot in the specified cluster from the specified source table. The cluster
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.snapshotTableAsync(name, cluster, snapshotId, description).get();
- * }
- *
- *
- * @param name The unique name of the table to have the snapshot taken. Values are of the form
- * `projects/<project>/instances/<instance>/tables/<table>`.
- * @param cluster The name of the cluster where the snapshot will be created in. Values are of the
- * form `projects/<project>/instances/<instance>/clusters/<cluster>`.
- * @param 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`.
- * @param description Description of the snapshot.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture snapshotTableAsync(
- TableName name, ClusterName cluster, SnapshotName snapshotId, String description) {
-
- SnapshotTableRequest request =
- SnapshotTableRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .setCluster(cluster == null ? null : cluster.toString())
- .setSnapshotId(snapshotId == null ? null : snapshotId.toString())
- .setDescription(description)
- .build();
- return snapshotTableAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new snapshot in the specified cluster from the specified source table. The cluster
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.snapshotTableAsync(name.toString(), cluster.toString(), snapshotId.toString(), description).get();
- * }
- *
- *
- * @param name The unique name of the table to have the snapshot taken. Values are of the form
- * `projects/<project>/instances/<instance>/tables/<table>`.
- * @param cluster The name of the cluster where the snapshot will be created in. Values are of the
- * form `projects/<project>/instances/<instance>/clusters/<cluster>`.
- * @param 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`.
- * @param description Description of the snapshot.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture snapshotTableAsync(
- String name, String cluster, String snapshotId, String description) {
-
- SnapshotTableRequest request =
- SnapshotTableRequest.newBuilder()
- .setName(name)
- .setCluster(cluster)
- .setSnapshotId(snapshotId)
- .setDescription(description)
- .build();
- return snapshotTableAsync(request);
+ public ConsistencyToken generateConsistencyToken(String tableId) {
+ return TableAdminResponses.convertTokenResponse(
+ this.stub
+ .generateConsistencyTokenCallable()
+ .call(composeGenerateConsistencyTokenRequest(tableId)));
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates a new snapshot in the specified cluster from the specified source table. The cluster
- * and the table must be in the same instance.
- *
- * 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.
+ * Generates a token to verify the replication status of table mutations invoked before this call
+ * asynchronously Token expires in 90 days
*
*
Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.snapshotTableAsync(request).get();
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * ConsistencyToken consistencyToken = client.generateConsistencyToken("tableId");
* }
- *
+ * }
*
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture snapshotTableAsync(
- SnapshotTableRequest request) {
- return snapshotTableOperationCallable().futureCall(request);
- }
+ public ApiFuture generateConsistencyTokenAsync(String tableId) {
+ ApiFuture tokenResp =
+ this.stub
+ .generateConsistencyTokenCallable()
+ .futureCall(composeGenerateConsistencyTokenRequest(tableId));
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new snapshot in the specified cluster from the specified source table. The cluster
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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<Operation> future = bigtableTableAdminClient.snapshotTableOperationCallable().futureCall(request);
- * // Do something
- * Snapshot response = future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- snapshotTableOperationCallable() {
- return stub.snapshotTableOperationCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new snapshot in the specified cluster from the specified source table. The cluster
- * and the table must be in the same instance.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.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 = bigtableTableAdminClient.snapshotTableCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- */
- public final UnaryCallable snapshotTableCallable() {
- return stub.snapshotTableCallable();
+ return ApiFutures.transform(
+ tokenResp,
+ new ApiFunction() {
+ @Override
+ public ConsistencyToken apply(GenerateConsistencyTokenResponse input) {
+ return TableAdminResponses.convertTokenResponse(input);
+ }
+ });
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets metadata information about the specified snapshot.
- *
- * 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.
+ * Checks replication consistency for the specified token consistency token
*
*
Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * Snapshot response = bigtableTableAdminClient.getSnapshot(name);
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * boolean consistent = client.isConsistent("tableId", token);
* }
- *
+ * }
*
- * @param name The unique name of the requested snapshot. Values are of the form
- * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
+ * @param token
*/
- public final Snapshot getSnapshot(SnapshotName name) {
-
- GetSnapshotRequest request =
- GetSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- return getSnapshot(request);
+ public boolean isConsistent(String tableId, ConsistencyToken token) {
+ return stub.checkConsistencyCallable()
+ .call(token.toProto(getTableName(tableId)))
+ .getConsistent();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets metadata information about the specified snapshot.
- *
- * 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.
+ * Checks replication consistency for the specified token consistency token asynchronously
*
*
Sample code:
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * Snapshot response = bigtableTableAdminClient.getSnapshot(name.toString());
+ * {@code
+ * try(BigtableTableAdminClient client = BigtableTableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]"))) {
+ * boolean consistent = client.isConsistentAsync("tableId", token);
* }
- *
+ * }
*
- * @param name The unique name of the requested snapshot. Values are of the form
- * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
+ * @param token
*/
- public final Snapshot getSnapshot(String name) {
+ public ApiFuture isConsistentAsync(String tableId, ConsistencyToken token) {
+ ApiFuture checkConsResp =
+ stub.checkConsistencyCallable().futureCall(token.toProto(getTableName(tableId)));
- GetSnapshotRequest request = GetSnapshotRequest.newBuilder().setName(name).build();
- return getSnapshot(request);
+ return ApiFutures.transform(
+ checkConsResp,
+ new ApiFunction() {
+ @Override
+ public Boolean apply(CheckConsistencyResponse input) {
+ return input.getConsistent();
+ }
+ });
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets metadata information about the specified snapshot.
- *
- * 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:
+ * Helper method to construct the table name in format:
+ * projects/{project}/instances/{instance}/tables/{tableId}
*
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * GetSnapshotRequest request = GetSnapshotRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Snapshot response = bigtableTableAdminClient.getSnapshot(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
+ * @return unique table name
*/
- private final Snapshot getSnapshot(GetSnapshotRequest request) {
- return getSnapshotCallable().call(request);
+ @VisibleForTesting
+ String getTableName(String tableId) {
+ return TableName.of(instanceName.getProject(), instanceName.getInstance(), tableId).toString();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets metadata information about the specified snapshot.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * GetSnapshotRequest request = GetSnapshotRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Snapshot> future = bigtableTableAdminClient.getSnapshotCallable().futureCall(request);
- * // Do something
- * Snapshot response = future.get();
- * }
- *
+ * Helper method to build an instance of ListTablesRequest
*/
- public final UnaryCallable getSnapshotCallable() {
- return stub.getSnapshotCallable();
+ @VisibleForTesting
+ ListTablesRequest composeListTableRequest() {
+ return ListTablesRequest.newBuilder().setParent(instanceName.toString()).build();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists all snapshots associated with the specified cluster.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * for (Snapshot element : bigtableTableAdminClient.listSnapshots(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
+ * Helper method to build an instance of GetTableRequest
*
- * @param 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/-`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- public final ListSnapshotsPagedResponse listSnapshots(ClusterName parent) {
- ListSnapshotsRequest request =
- ListSnapshotsRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .build();
- return listSnapshots(request);
+ @VisibleForTesting
+ GetTableRequest composeGetTableRequest(String tableId) {
+ return GetTableRequest.newBuilder().setName(getTableName(tableId)).build();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists all snapshots associated with the specified cluster.
+ * Helper method to build an instance of DeleteTableRequest
*
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * for (Snapshot element : bigtableTableAdminClient.listSnapshots(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @param 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/-`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- public final ListSnapshotsPagedResponse listSnapshots(String parent) {
- ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder().setParent(parent).build();
- return listSnapshots(request);
+ @VisibleForTesting
+ DeleteTableRequest composeDeleteTableRequest(String tableId) {
+ return DeleteTableRequest.newBuilder().setName(getTableName(tableId)).build();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists all snapshots associated with the specified cluster.
- *
- * 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.
+ * Helper method to build an instance of DropRowRangeRequest
*
- *
Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Snapshot element : bigtableTableAdminClient.listSnapshots(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
+ * @param rowKeyPrefix
+ * @param boolean dropAll
*/
- public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest request) {
- return listSnapshotsPagedCallable().call(request);
- }
+ @VisibleForTesting
+ DropRowRangeRequest composeDropRowRangeRequest(
+ String tableId, ByteString rowKeyPrefix, boolean dropAll) {
+ Builder dropRowReq = DropRowRangeRequest.newBuilder().setName(getTableName(tableId));
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all snapshots associated with the specified cluster.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListSnapshotsPagedResponse> future = bigtableTableAdminClient.listSnapshotsPagedCallable().futureCall(request);
- * // Do something
- * for (Snapshot element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- listSnapshotsPagedCallable() {
- return stub.listSnapshotsPagedCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all snapshots associated with the specified cluster.
- *
- * 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 (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
- * ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListSnapshotsResponse response = bigtableTableAdminClient.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 UnaryCallable listSnapshotsCallable() {
- return stub.listSnapshotsCallable();
+ if (dropAll) {
+ dropRowReq.setDeleteAllDataFromTable(true);
+ } else {
+ dropRowReq.setRowKeyPrefix(rowKeyPrefix);
+ }
+ return dropRowReq.build();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently deletes the specified snapshot.
- *
- * 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.
+ * Helper method to build an instance of GenerateConsistencyTokenRequest
*
- *
Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * bigtableTableAdminClient.deleteSnapshot(name);
- * }
- *
- *
- * @param name The unique name of the snapshot to be deleted. Values are of the form
- * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param tableId
*/
- public final void deleteSnapshot(SnapshotName name) {
-
- DeleteSnapshotRequest request =
- DeleteSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteSnapshot(request);
+ @VisibleForTesting
+ GenerateConsistencyTokenRequest composeGenerateConsistencyTokenRequest(String tableId) {
+ return GenerateConsistencyTokenRequest.newBuilder().setName(getTableName(tableId)).build();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently deletes the specified snapshot.
- *
- * 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.
+ * Helper method to convert ListTablesResponse to List
*
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * bigtableTableAdminClient.deleteSnapshot(name.toString());
- * }
- *
- *
- * @param name The unique name of the snapshot to be deleted. Values are of the form
- * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param listTablesResponse
*/
- public final void deleteSnapshot(String name) {
+ @VisibleForTesting
+ static List convertToTableNames(ListTablesResponse listTablesResponse) {
+ List tableNames = new ArrayList<>();
- DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder().setName(name).build();
- deleteSnapshot(request);
+ for (com.google.bigtable.admin.v2.Table table : listTablesResponse.getTablesList()) {
+ tableNames.add(TableName.parse(table.getName()));
+ }
+ return tableNames;
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently deletes the specified snapshot.
- *
- * 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.
+ * Helper method to transform ApiFuture to ApiFuture
*
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * bigtableTableAdminClient.deleteSnapshot(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @param future
*/
- private final void deleteSnapshot(DeleteSnapshotRequest request) {
- deleteSnapshotCallable().call(request);
+ @VisibleForTesting
+ static ApiFuture transformToTableResponse(
+ ApiFuture future) {
+ return ApiFutures.transform(
+ future,
+ new ApiFunction() {
+ @Override
+ public Table apply(com.google.bigtable.admin.v2.Table table) {
+ return TableAdminResponses.convertTable(table);
+ }
+ });
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Permanently deletes the specified snapshot.
- *
- * 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.
+ * Helper method to transform ApiFuture to ApiFuture
*
- * Sample code:
- *
- *
- * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
- * SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
- * DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = bigtableTableAdminClient.deleteSnapshotCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
+ * @param future
*/
- public final UnaryCallable deleteSnapshotCallable() {
- return stub.deleteSnapshotCallable();
- }
-
- @Override
- public final void close() {
- stub.close();
- }
-
- @Override
- public void shutdown() {
- stub.shutdown();
- }
-
- @Override
- public boolean isShutdown() {
- return stub.isShutdown();
- }
-
- @Override
- public boolean isTerminated() {
- return stub.isTerminated();
- }
-
- @Override
- public void shutdownNow() {
- stub.shutdownNow();
- }
-
- @Override
- public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
- return stub.awaitTermination(duration, unit);
- }
-
- public static class ListTablesPagedResponse
- extends AbstractPagedListResponse<
- ListTablesRequest, ListTablesResponse, Table, ListTablesPage,
- ListTablesFixedSizeCollection> {
-
- public static ApiFuture createAsync(
- PageContext context,
- ApiFuture futureResponse) {
- ApiFuture futurePage =
- ListTablesPage.createEmptyPage().createPageAsync(context, futureResponse);
- return ApiFutures.transform(
- futurePage,
- new ApiFunction() {
- @Override
- public ListTablesPagedResponse apply(ListTablesPage input) {
- return new ListTablesPagedResponse(input);
- }
- });
- }
-
- private ListTablesPagedResponse(ListTablesPage page) {
- super(page, ListTablesFixedSizeCollection.createEmptyCollection());
- }
- }
-
- public static class ListTablesPage
- extends AbstractPage {
-
- private ListTablesPage(
- PageContext context,
- ListTablesResponse response) {
- super(context, response);
- }
-
- private static ListTablesPage createEmptyPage() {
- return new ListTablesPage(null, null);
- }
-
- @Override
- protected ListTablesPage createPage(
- PageContext context,
- ListTablesResponse response) {
- return new ListTablesPage(context, response);
- }
-
- @Override
- public ApiFuture createPageAsync(
- PageContext context,
- ApiFuture futureResponse) {
- return super.createPageAsync(context, futureResponse);
- }
- }
-
- public static class ListTablesFixedSizeCollection
- extends AbstractFixedSizeCollection<
- ListTablesRequest, ListTablesResponse, Table, ListTablesPage,
- ListTablesFixedSizeCollection> {
-
- private ListTablesFixedSizeCollection(List pages, int collectionSize) {
- super(pages, collectionSize);
- }
-
- private static ListTablesFixedSizeCollection createEmptyCollection() {
- return new ListTablesFixedSizeCollection(null, 0);
- }
-
- @Override
- protected ListTablesFixedSizeCollection createCollection(
- List pages, int collectionSize) {
- return new ListTablesFixedSizeCollection(pages, collectionSize);
- }
- }
-
- public static class ListSnapshotsPagedResponse
- extends AbstractPagedListResponse<
- ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage,
- ListSnapshotsFixedSizeCollection> {
-
- public static ApiFuture createAsync(
- PageContext context,
- ApiFuture futureResponse) {
- ApiFuture futurePage =
- ListSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse);
- return ApiFutures.transform(
- futurePage,
- new ApiFunction() {
- @Override
- public ListSnapshotsPagedResponse apply(ListSnapshotsPage input) {
- return new ListSnapshotsPagedResponse(input);
- }
- });
- }
-
- private ListSnapshotsPagedResponse(ListSnapshotsPage page) {
- super(page, ListSnapshotsFixedSizeCollection.createEmptyCollection());
- }
- }
-
- public static class ListSnapshotsPage
- extends AbstractPage<
- ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage> {
-
- private ListSnapshotsPage(
- PageContext context,
- ListSnapshotsResponse response) {
- super(context, response);
- }
-
- private static ListSnapshotsPage createEmptyPage() {
- return new ListSnapshotsPage(null, null);
- }
-
- @Override
- protected ListSnapshotsPage createPage(
- PageContext context,
- ListSnapshotsResponse response) {
- return new ListSnapshotsPage(context, response);
- }
-
- @Override
- public ApiFuture createPageAsync(
- PageContext context,
- ApiFuture futureResponse) {
- return super.createPageAsync(context, futureResponse);
- }
- }
-
- public static class ListSnapshotsFixedSizeCollection
- extends AbstractFixedSizeCollection<
- ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage,
- ListSnapshotsFixedSizeCollection> {
-
- private ListSnapshotsFixedSizeCollection(List