Skip to content

Commit f7a1b26

Browse files
yihanzhenchingor13
authored andcommitted
---
yaml --- r: 12413 b: refs/heads/autosynth-tasks c: b959329 h: refs/heads/master i: 12411: 0fc61d9
1 parent a77de74 commit f7a1b26

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

  • branches/autosynth-tasks/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ refs/heads/autosynth-scheduler: efd0edcd8fc21ccea9b4ffb0e0c4949ee04115aa
142142
refs/heads/autosynth-securitycenter: 80dc94847b954c97a641519177c98dc8e9e9fbe1
143143
refs/heads/autosynth-spanner: 1804eb46dd34a05b47163758d376a7fac49188f1
144144
refs/heads/autosynth-speech: 631df42a628621fe42eb4974c9eb725b2fe8e473
145-
refs/heads/autosynth-tasks: 5f29ea236c301f33e4d40bd0acb1718e03b54ba9
145+
refs/heads/autosynth-tasks: b9593290347854a2c793eab4490a6a05ee8d9338
146146
refs/heads/autosynth-texttospeech: 14a1e3455c7b78a9558ab1bb74934b3f7b705f11
147147
refs/heads/autosynth-trace: ce82b40155f6e05d2ed50d78386b16203dbf26d4
148148
refs/heads/autosynth-websecurityscanner: 33a2aab15b740c008d320c453a6ce20ca57ca844

branches/autosynth-tasks/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ public OperationFuture<Database, CreateDatabaseMetadata> createDatabase(
452452
String createStatement = "CREATE DATABASE `" + databaseId + "`";
453453
OperationFuture<com.google.spanner.admin.database.v1.Database, CreateDatabaseMetadata>
454454
rawOperationFuture = rpc.createDatabase(instanceName, createStatement, statements);
455-
return new OperationFutureImpl(
455+
return new OperationFutureImpl<Database, CreateDatabaseMetadata>(
456456
rawOperationFuture.getPollingFuture(),
457457
rawOperationFuture.getInitialFuture(),
458458
new ApiFunction<OperationSnapshot, Database>() {
@@ -498,19 +498,20 @@ public OperationFuture<Void, UpdateDatabaseDdlMetadata> updateDatabaseDdl(
498498
final String opId = operationId != null ? operationId : randomOperationId();
499499
OperationFuture<Empty, UpdateDatabaseDdlMetadata> rawOperationFuture =
500500
rpc.updateDatabaseDdl(dbName, statements, opId);
501-
return new OperationFutureImpl(
501+
return new OperationFutureImpl<Void, UpdateDatabaseDdlMetadata>(
502502
rawOperationFuture.getPollingFuture(),
503503
rawOperationFuture.getInitialFuture(),
504504
new ApiFunction<OperationSnapshot, Void>() {
505505
@Override
506506
public Void apply(OperationSnapshot snapshot) {
507+
ProtoOperationTransformers.ResponseTransformer.create(Empty.class).apply(snapshot);
507508
return null;
508509
}
509510
},
510511
ProtoOperationTransformers.MetadataTransformer.create(UpdateDatabaseDdlMetadata.class),
511-
new ApiFunction<Exception, Database>() {
512+
new ApiFunction<Exception, Void>() {
512513
@Override
513-
public Database apply(Exception e) {
514+
public Void apply(Exception e) {
514515
throw SpannerExceptionFactory.newSpannerException(e);
515516
}
516517
});
@@ -799,12 +800,12 @@ public Timestamp writeAtLeastOnce(Iterable<Mutation> mutations) throws SpannerEx
799800
Mutation.toProto(mutations, mutationsProto);
800801
final CommitRequest request =
801802
CommitRequest.newBuilder()
802-
.setSession(name)
803-
.addAllMutations(mutationsProto)
804-
.setSingleUseTransaction(
805-
TransactionOptions.newBuilder()
806-
.setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()))
807-
.build();
803+
.setSession(name)
804+
.addAllMutations(mutationsProto)
805+
.setSingleUseTransaction(
806+
TransactionOptions.newBuilder()
807+
.setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()))
808+
.build();
808809
Span span = tracer.spanBuilder(COMMIT).startSpan();
809810
try (Scope s = tracer.withSpan(span)) {
810811
CommitResponse response =
@@ -894,11 +895,11 @@ ByteString beginTransaction() {
894895
try (Scope s = tracer.withSpan(span)) {
895896
final BeginTransactionRequest request =
896897
BeginTransactionRequest.newBuilder()
897-
.setSession(name)
898-
.setOptions(
899-
TransactionOptions.newBuilder()
900-
.setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()))
901-
.build();
898+
.setSession(name)
899+
.setOptions(
900+
TransactionOptions.newBuilder()
901+
.setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()))
902+
.build();
902903
Transaction txn =
903904
runWithRetries(
904905
new Callable<Transaction>() {
@@ -1103,7 +1104,7 @@ CloseableIterator<PartialResultSet> startStream(@Nullable ByteString resumeToken
11031104
}
11041105
};
11051106
return new GrpcResultSet(stream, this, queryMode);
1106-
}
1107+
}
11071108

11081109
/**
11091110
* Called before any read or query is started to perform state checks and initializations.
@@ -1649,7 +1650,7 @@ public com.google.spanner.v1.ResultSet call() throws Exception {
16491650
}
16501651
// For standard DML, using the exact row count.
16511652
return resultSet.getStats().getRowCountExact();
1652-
}
1653+
}
16531654
}
16541655

16551656
/**
@@ -2792,7 +2793,7 @@ ResultSetMetadata getMetadata() throws SpannerException {
27922793
* results will return null.
27932794
*/
27942795
@Nullable
2795-
ResultSetStats getStats() {
2796+
ResultSetStats getStats() {
27962797
return statistics;
27972798
}
27982799

0 commit comments

Comments
 (0)