Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f3aa527
Add GapicSpannerRpc stub (#3016)
yihanzhen Mar 12, 2018
91dd689
spanner: implement partitionRead (#3022)
pongad Mar 13, 2018
be50109
spanner: implement LRO methods using GAPIC stub (#3039)
pongad Mar 19, 2018
ba0cf43
Add implementation to: (#3043)
yihanzhen Mar 21, 2018
b3b7f04
spanner: move admin clients to GAPIC stub (#3067)
pongad Mar 29, 2018
50c6b8b
Merge branch 'master' into spanner-gapic-migration
yihanzhen Apr 5, 2018
75d1d0b
Merge pull request #3130 from hzyi-google/spanner-gapic-migration
pongad Apr 5, 2018
45e76f3
Spanner: migrate all unary call methods to gapic and inject headers (…
yihanzhen Apr 13, 2018
02f0bc7
Spanner: migrate streaming methods to gapic (#3139)
yihanzhen Apr 17, 2018
c4d2ff6
Merge branch 'master' into spanner-gapic-migration
yihanzhen May 3, 2018
4e1dfc0
merge conficts
yihanzhen May 3, 2018
6cc31d1
Merge pull request #3231 from hzyi-google/spanner-gapic-migration
yihanzhen May 3, 2018
f9df8a2
Spanner gapic migration lro methods (#3166)
yihanzhen May 9, 2018
bc647b1
Make ChannelPool work (#3258)
yihanzhen May 31, 2018
4d23ca6
Merge branch 'master' into spanner-gapic-migration
yihanzhen May 31, 2018
2b772ac
Merge branch 'master' into spanner-gapic-migration
yihanzhen Jun 1, 2018
0a3e3e7
Merge pull request #3330 from hzyi-google/spanner-gapic-migration
yihanzhen Jun 4, 2018
0de6267
Spanner gapic migration error augmentation with interceptor (#3304)
yihanzhen Jun 4, 2018
0e9f78c
Add watchdog interceptor (#3346)
yihanzhen Jun 5, 2018
174443b
Clean up Spanner before merging to master (#3362)
yihanzhen Jun 22, 2018
c2ae349
Spanner Gapic Migration: fix updateDatabaseDdl (#3403)
yihanzhen Jul 2, 2018
fb4df7e
Merge branch 'master' into spanner-gapic-migration
yihanzhen Oct 24, 2018
ee51fe2
make tests pass
Oct 26, 2018
7adaa1f
Merge pull request #3853 from hzyi-google/spanner-gapic-migration
yihanzhen Oct 29, 2018
6f6070a
get examples work
yihanzhen Oct 31, 2018
1c7e456
format
yihanzhen Oct 31, 2018
5554ac4
more format
yihanzhen Oct 31, 2018
623934e
Merge branch 'master' into spanner-gapic-migration
sduskis Oct 31, 2018
36dc526
Merge branch 'master' into spanner-gapic-migration
sduskis Nov 5, 2018
a821df3
Merge branch 'master' into spanner-gapic-migration
JustinBeckwith Nov 6, 2018
c3aae5b
code review
yihanzhen Nov 6, 2018
0549abb
more format
yihanzhen Nov 6, 2018
97dade0
google-format
yihanzhen Nov 6, 2018
4a2b169
move variable locations
yihanzhen Nov 6, 2018
dbce7b0
remove unused files
yihanzhen Nov 6, 2018
5a4ba7c
Merge branch 'master' into spanner-gapic-migration
yihanzhen Nov 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

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

import com.google.api.gax.longrunning.OperationFuture;
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;

/**
Expand Down Expand Up @@ -51,7 +52,7 @@ public Database reload() throws SpannerException {
* one. This must be unique within a database abd must be a valid identifier
* [a-zA-Z][a-zA-Z0-9_]*.
*/
public Operation<Void, UpdateDatabaseDdlMetadata> updateDdl(
public OperationFuture<Void, UpdateDatabaseDdlMetadata> updateDdl(
Iterable<String> statements, String operationId) throws SpannerException {
return dbClient.updateDatabaseDdl(instance(), database(), statements, operationId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.spanner;

import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.Page;
import com.google.cloud.spanner.Options.ListOption;
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
Expand All @@ -29,7 +30,8 @@ public interface DatabaseAdminClient {
* Creates a new database in a Cloud Spanner instance.
*
* <p>Example to create database.
* <pre> {@code
*
* <pre>{@code
* String instanceId = my_instance_id;
* String databaseId = my_database_id;
* Operation<Database, CreateDatabaseMetadata> op = dbAdminClient
Expand Down Expand Up @@ -58,19 +60,19 @@ public interface DatabaseAdminClient {
* @param statements DDL statements to run while creating the database, for example {@code CREATE
* TABLE MyTable ( ... )}. This should not include {@code CREATE DATABASE} statement.
*/
Operation<Database, CreateDatabaseMetadata> createDatabase(
OperationFuture<Database, CreateDatabaseMetadata> createDatabase(
String instanceId, String databaseId, Iterable<String> statements) throws SpannerException;

/**
* Gets the current state of a Cloud Spanner database.
/**
* Gets the current state of a Cloud Spanner database.
*
* <p>Example to getDatabase.
* <pre> {@code
*
* <pre>{@code
* String instanceId = my_instance_id;
* String databaseId = my_database_id;
* Database db = dbAdminClient.getDatabase(instanceId, databaseId);
* }</pre>
*
*/
Database getDatabase(String instanceId, String databaseId) throws SpannerException;

Expand All @@ -84,7 +86,8 @@ Operation<Database, CreateDatabaseMetadata> createDatabase(
* fails, all subsequent statements in the batch are automatically cancelled.
*
* <p>Example to update the database DDL.
* <pre> {@code
*
* <pre>{@code
* String instanceId = my_instance_id;
* String databaseId = my_database_id;
* dbAdminClient.updateDatabaseDdl(instanceId,
Expand All @@ -97,7 +100,7 @@ Operation<Database, CreateDatabaseMetadata> createDatabase(
* one. This must be unique within a database abd must be a valid identifier
* [a-zA-Z][a-zA-Z0-9_]*.
*/
Operation<Void, UpdateDatabaseDdlMetadata> updateDatabaseDdl(
OperationFuture<Void, UpdateDatabaseDdlMetadata> updateDatabaseDdl(
String instanceId,
String databaseId,
Iterable<String> statements,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.spanner;

import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.Page;
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
import com.google.spanner.admin.instance.v1.UpdateInstanceMetadata;
Expand Down Expand Up @@ -104,7 +105,7 @@ public void delete() {
instanceClient.deleteInstance(instanceId());
}

public Operation<Instance, UpdateInstanceMetadata> update(
public OperationFuture<Instance, UpdateInstanceMetadata> update(
InstanceInfo.InstanceField... fieldsToUpdate) {
return instanceClient.updateInstance(this, fieldsToUpdate);
}
Expand All @@ -125,7 +126,7 @@ public Database getDatabase(String databaseId) {
* @param statements DDL statements to run while creating the database, for example {@code CREATE
* TABLE MyTable ( ... )}. This should not include {@code CREATE DATABASE} statement.
*/
public Operation<Database, CreateDatabaseMetadata> createDatabase(
public OperationFuture<Database, CreateDatabaseMetadata> createDatabase(
String databaseId, Iterable<String> statements) throws SpannerException {
return dbClient.createDatabase(instanceId(), databaseId, statements);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.spanner;

import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.Page;
import com.google.cloud.spanner.Options.ListOption;
import com.google.spanner.admin.instance.v1.CreateInstanceMetadata;
Expand Down Expand Up @@ -51,29 +52,30 @@ public interface InstanceAdminClient {
* upon completion of this request:
*
* <ul>
* <li> The instance is readable via the API, with all requested attributes but no allocated
* <li>The instance is readable via the API, with all requested attributes but no allocated
* resources.
* <li> Its state is {@code CREATING}.
* <li>Its state is {@code CREATING}.
* </ul>
*
* Until completion of the returned operation:
*
* <ul>
* <li> Cancelling the operation renders the instance immediately unreadable via the API.
* <li> The instance can be deleted.
* <li> All other attempts to modify the instance are rejected.
* <li>Cancelling the operation renders the instance immediately unreadable via the API.
* <li>The instance can be deleted.
* <li>All other attempts to modify the instance are rejected.
* </ul>
*
* Upon completion of the returned operation:
*
* <ul>
* <li> Billing for all successfully-allocated resources begins (some types may have lower than
* <li>Billing for all successfully-allocated resources begins (some types may have lower than
* the requested levels).
* <li> Databases can be created in the instance.
* <li> The instance's allocated resource levels are readable via the
* <li>Databases can be created in the instance.
* <li>The instance's allocated resource levels are readable via the
* </ul>
*
* <!--SNIPPET instance_admin_client_create_instance-->
*
* <pre>{@code
* final String instanceId = my_instance_id;
* final String configId = my_config_id;
Expand All @@ -88,9 +90,10 @@ public interface InstanceAdminClient {
* .build());
* op.waitFor();
* }</pre>
*
* <!--SNIPPET instance_admin_client_create_instance-->
*/
Operation<Instance, CreateInstanceMetadata> createInstance(InstanceInfo instance)
OperationFuture<Instance, CreateInstanceMetadata> createInstance(InstanceInfo instance)
throws SpannerException;

/** Gets an instance. */
Expand Down Expand Up @@ -142,31 +145,32 @@ Operation<Instance, CreateInstanceMetadata> createInstance(InstanceInfo instance
* <p>Immediately upon completion of this request:
*
* <ul>
* <li> For resource types for which a decrease in the instance's allocation has been requested,
* <li>For resource types for which a decrease in the instance's allocation has been requested,
* billing is based on the newly-requested level.
* </ul>
*
* Until completion of the returned operation:
*
* <ul>
* <li> Cancelling the operation sets its metadata's
* <li>Cancelling the operation sets its metadata's
* [cancel_time][UpdateInstanceMetadata.cancel_time], and begins restoring resources to
* their pre-request values. The operation is guaranteed to succeed at undoing all resource
* changes, after which point it terminates with a `CANCELLED` status.
* <li> All other attempts to modify the instance are rejected.
* <li> Reading the instance via the API continues to give the pre-request resource levels.
* <li>All other attempts to modify the instance are rejected.
* <li>Reading the instance via the API continues to give the pre-request resource levels.
* </ul>
*
* Upon completion of the returned operation:
*
* <ul>
* <li> Billing begins for all successfully-allocated resources (some types may have lower than
* <li>Billing begins for all successfully-allocated resources (some types may have lower than
* the requested levels).
* <li> All newly-reserved resources are available for serving the instance's tables.
* <li> The instance's new resource levels are readable via the API.
* <li>All newly-reserved resources are available for serving the instance's tables.
* <li>The instance's new resource levels are readable via the API.
* </ul>
*
* <!--SNIPPET instance_admin_client_update_instance-->
*
* <pre>{@code
* Instance instance = my_instance;
* final String clientProject = my_client_project;
Expand All @@ -184,9 +188,10 @@ Operation<Instance, CreateInstanceMetadata> createInstance(InstanceInfo instance
* instanceAdminClient.updateInstance(toUpdate, InstanceInfo.InstanceField.DISPLAY_NAME);
* op.waitFor().getResult();
* }</pre>
*
* <!--SNIPPET instance_admin_client_update_instance-->
*/
Operation<Instance, UpdateInstanceMetadata> updateInstance(
OperationFuture<Instance, UpdateInstanceMetadata> updateInstance(
InstanceInfo instance, InstanceInfo.InstanceField... fieldsToUpdate);

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