Skip to content

Commit a389bf7

Browse files
authored
---
yaml --- r: 11649 b: refs/heads/autosynth-pubsub c: 28fab80 h: refs/heads/master i: 11647: fb83105
1 parent 2160f59 commit a389bf7

27 files changed

Lines changed: 1475 additions & 1154 deletions

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ refs/heads/autosynth-compute: fa508ebab5b6a1db14949441c8de868cefbcf1a6
116116
refs/heads/autosynth-container: d0346e84b1f26e3dc10444450a998f357a43bcef
117117
refs/heads/autosynth-dataproc: c0f21dd811166848a60f810565a5614bb9c7f47e
118118
refs/heads/autosynth-monitoring: 28bf7ca67c0aab4815884e5d6253aaa8aa3baa1c
119-
refs/heads/autosynth-pubsub: 269546f432ae2607d3fae1cb17d6d3371e3bb595
119+
refs/heads/autosynth-pubsub: 28fab80ed42dcdf56bac22f67b6e262e3ad54cd2
120120
refs/heads/autosynth-video-intelligence: 06fb1841ae847f4ef79a62ba995efbabc213edf8
121121
refs/heads/autosynth-vision: 6bece1ee6c1c41d5822c72bf0d6a82484166b402
122122
refs/heads/spanner: 54a5e197bfe0a004e13c190427f46c3413ab572d

branches/autosynth-pubsub/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Database.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static com.google.common.base.Preconditions.checkArgument;
2020

21+
import com.google.api.gax.longrunning.OperationFuture;
2122
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
2223

2324
/**
@@ -51,7 +52,7 @@ public Database reload() throws SpannerException {
5152
* one. This must be unique within a database abd must be a valid identifier
5253
* [a-zA-Z][a-zA-Z0-9_]*.
5354
*/
54-
public Operation<Void, UpdateDatabaseDdlMetadata> updateDdl(
55+
public OperationFuture<Void, UpdateDatabaseDdlMetadata> updateDdl(
5556
Iterable<String> statements, String operationId) throws SpannerException {
5657
return dbClient.updateDatabaseDdl(instance(), database(), statements, operationId);
5758
}

branches/autosynth-pubsub/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseAdminClient.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.spanner;
1818

19+
import com.google.api.gax.longrunning.OperationFuture;
1920
import com.google.api.gax.paging.Page;
2021
import com.google.cloud.spanner.Options.ListOption;
2122
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
@@ -29,7 +30,8 @@ public interface DatabaseAdminClient {
2930
* Creates a new database in a Cloud Spanner instance.
3031
*
3132
* <p>Example to create database.
32-
* <pre> {@code
33+
*
34+
* <pre>{@code
3335
* String instanceId = my_instance_id;
3436
* String databaseId = my_database_id;
3537
* Operation<Database, CreateDatabaseMetadata> op = dbAdminClient
@@ -58,19 +60,19 @@ public interface DatabaseAdminClient {
5860
* @param statements DDL statements to run while creating the database, for example {@code CREATE
5961
* TABLE MyTable ( ... )}. This should not include {@code CREATE DATABASE} statement.
6062
*/
61-
Operation<Database, CreateDatabaseMetadata> createDatabase(
63+
OperationFuture<Database, CreateDatabaseMetadata> createDatabase(
6264
String instanceId, String databaseId, Iterable<String> statements) throws SpannerException;
6365

64-
/**
65-
* Gets the current state of a Cloud Spanner database.
66+
/**
67+
* Gets the current state of a Cloud Spanner database.
6668
*
6769
* <p>Example to getDatabase.
68-
* <pre> {@code
70+
*
71+
* <pre>{@code
6972
* String instanceId = my_instance_id;
7073
* String databaseId = my_database_id;
7174
* Database db = dbAdminClient.getDatabase(instanceId, databaseId);
7275
* }</pre>
73-
*
7476
*/
7577
Database getDatabase(String instanceId, String databaseId) throws SpannerException;
7678

@@ -84,7 +86,8 @@ Operation<Database, CreateDatabaseMetadata> createDatabase(
8486
* fails, all subsequent statements in the batch are automatically cancelled.
8587
*
8688
* <p>Example to update the database DDL.
87-
* <pre> {@code
89+
*
90+
* <pre>{@code
8891
* String instanceId = my_instance_id;
8992
* String databaseId = my_database_id;
9093
* dbAdminClient.updateDatabaseDdl(instanceId,
@@ -97,7 +100,7 @@ Operation<Database, CreateDatabaseMetadata> createDatabase(
97100
* one. This must be unique within a database abd must be a valid identifier
98101
* [a-zA-Z][a-zA-Z0-9_]*.
99102
*/
100-
Operation<Void, UpdateDatabaseDdlMetadata> updateDatabaseDdl(
103+
OperationFuture<Void, UpdateDatabaseDdlMetadata> updateDatabaseDdl(
101104
String instanceId,
102105
String databaseId,
103106
Iterable<String> statements,

branches/autosynth-pubsub/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.spanner;
1818

19+
import com.google.api.gax.longrunning.OperationFuture;
1920
import com.google.api.gax.paging.Page;
2021
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
2122
import com.google.spanner.admin.instance.v1.UpdateInstanceMetadata;
@@ -104,7 +105,7 @@ public void delete() {
104105
instanceClient.deleteInstance(instanceId());
105106
}
106107

107-
public Operation<Instance, UpdateInstanceMetadata> update(
108+
public OperationFuture<Instance, UpdateInstanceMetadata> update(
108109
InstanceInfo.InstanceField... fieldsToUpdate) {
109110
return instanceClient.updateInstance(this, fieldsToUpdate);
110111
}
@@ -125,7 +126,7 @@ public Database getDatabase(String databaseId) {
125126
* @param statements DDL statements to run while creating the database, for example {@code CREATE
126127
* TABLE MyTable ( ... )}. This should not include {@code CREATE DATABASE} statement.
127128
*/
128-
public Operation<Database, CreateDatabaseMetadata> createDatabase(
129+
public OperationFuture<Database, CreateDatabaseMetadata> createDatabase(
129130
String databaseId, Iterable<String> statements) throws SpannerException {
130131
return dbClient.createDatabase(instanceId(), databaseId, statements);
131132
}

branches/autosynth-pubsub/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceAdminClient.java

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.spanner;
1818

19+
import com.google.api.gax.longrunning.OperationFuture;
1920
import com.google.api.gax.paging.Page;
2021
import com.google.cloud.spanner.Options.ListOption;
2122
import com.google.spanner.admin.instance.v1.CreateInstanceMetadata;
@@ -51,29 +52,30 @@ public interface InstanceAdminClient {
5152
* upon completion of this request:
5253
*
5354
* <ul>
54-
* <li> The instance is readable via the API, with all requested attributes but no allocated
55+
* <li>The instance is readable via the API, with all requested attributes but no allocated
5556
* resources.
56-
* <li> Its state is {@code CREATING}.
57+
* <li>Its state is {@code CREATING}.
5758
* </ul>
5859
*
5960
* Until completion of the returned operation:
6061
*
6162
* <ul>
62-
* <li> Cancelling the operation renders the instance immediately unreadable via the API.
63-
* <li> The instance can be deleted.
64-
* <li> All other attempts to modify the instance are rejected.
63+
* <li>Cancelling the operation renders the instance immediately unreadable via the API.
64+
* <li>The instance can be deleted.
65+
* <li>All other attempts to modify the instance are rejected.
6566
* </ul>
6667
*
6768
* Upon completion of the returned operation:
6869
*
6970
* <ul>
70-
* <li> Billing for all successfully-allocated resources begins (some types may have lower than
71+
* <li>Billing for all successfully-allocated resources begins (some types may have lower than
7172
* the requested levels).
72-
* <li> Databases can be created in the instance.
73-
* <li> The instance's allocated resource levels are readable via the
73+
* <li>Databases can be created in the instance.
74+
* <li>The instance's allocated resource levels are readable via the
7475
* </ul>
7576
*
7677
* <!--SNIPPET instance_admin_client_create_instance-->
78+
*
7779
* <pre>{@code
7880
* final String instanceId = my_instance_id;
7981
* final String configId = my_config_id;
@@ -88,9 +90,10 @@ public interface InstanceAdminClient {
8890
* .build());
8991
* op.waitFor();
9092
* }</pre>
93+
*
9194
* <!--SNIPPET instance_admin_client_create_instance-->
9295
*/
93-
Operation<Instance, CreateInstanceMetadata> createInstance(InstanceInfo instance)
96+
OperationFuture<Instance, CreateInstanceMetadata> createInstance(InstanceInfo instance)
9497
throws SpannerException;
9598

9699
/** Gets an instance. */
@@ -142,31 +145,32 @@ Operation<Instance, CreateInstanceMetadata> createInstance(InstanceInfo instance
142145
* <p>Immediately upon completion of this request:
143146
*
144147
* <ul>
145-
* <li> For resource types for which a decrease in the instance's allocation has been requested,
148+
* <li>For resource types for which a decrease in the instance's allocation has been requested,
146149
* billing is based on the newly-requested level.
147150
* </ul>
148151
*
149152
* Until completion of the returned operation:
150153
*
151154
* <ul>
152-
* <li> Cancelling the operation sets its metadata's
155+
* <li>Cancelling the operation sets its metadata's
153156
* [cancel_time][UpdateInstanceMetadata.cancel_time], and begins restoring resources to
154157
* their pre-request values. The operation is guaranteed to succeed at undoing all resource
155158
* changes, after which point it terminates with a `CANCELLED` status.
156-
* <li> All other attempts to modify the instance are rejected.
157-
* <li> Reading the instance via the API continues to give the pre-request resource levels.
159+
* <li>All other attempts to modify the instance are rejected.
160+
* <li>Reading the instance via the API continues to give the pre-request resource levels.
158161
* </ul>
159162
*
160163
* Upon completion of the returned operation:
161164
*
162165
* <ul>
163-
* <li> Billing begins for all successfully-allocated resources (some types may have lower than
166+
* <li>Billing begins for all successfully-allocated resources (some types may have lower than
164167
* the requested levels).
165-
* <li> All newly-reserved resources are available for serving the instance's tables.
166-
* <li> The instance's new resource levels are readable via the API.
168+
* <li>All newly-reserved resources are available for serving the instance's tables.
169+
* <li>The instance's new resource levels are readable via the API.
167170
* </ul>
168171
*
169172
* <!--SNIPPET instance_admin_client_update_instance-->
173+
*
170174
* <pre>{@code
171175
* Instance instance = my_instance;
172176
* final String clientProject = my_client_project;
@@ -184,9 +188,10 @@ Operation<Instance, CreateInstanceMetadata> createInstance(InstanceInfo instance
184188
* instanceAdminClient.updateInstance(toUpdate, InstanceInfo.InstanceField.DISPLAY_NAME);
185189
* op.waitFor().getResult();
186190
* }</pre>
191+
*
187192
* <!--SNIPPET instance_admin_client_update_instance-->
188193
*/
189-
Operation<Instance, UpdateInstanceMetadata> updateInstance(
194+
OperationFuture<Instance, UpdateInstanceMetadata> updateInstance(
190195
InstanceInfo instance, InstanceInfo.InstanceField... fieldsToUpdate);
191196

192197
/** Returns a builder for {@code Instance} object with the given id. */

0 commit comments

Comments
 (0)