Skip to content

Commit a9fdd00

Browse files
yihanzhenchingor13
authored andcommitted
---
yaml --- r: 12267 b: refs/heads/autosynth-redis c: b959329 h: refs/heads/master i: 12265: de6aebe 12263: ce9b39b
1 parent 1bdffdf commit a9fdd00

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

  • branches/autosynth-redis/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
@@ -137,7 +137,7 @@ refs/heads/autosynth-iot: 9d732be07d99843d8cb53d34ec0837328a807fce
137137
refs/heads/autosynth-kms: dcc6e15d68759010c8735cc868135bd7e6c1cc5f
138138
refs/heads/autosynth-language: 8972866b016473559702424205ce5569de47b34d
139139
refs/heads/autosynth-os-login: daa910328b954bbe87068f684a3088ed910f1ddf
140-
refs/heads/autosynth-redis: 5f29ea236c301f33e4d40bd0acb1718e03b54ba9
140+
refs/heads/autosynth-redis: b9593290347854a2c793eab4490a6a05ee8d9338
141141
refs/heads/autosynth-scheduler: 22f042c3461cee9346c46fdade5c8fad1a80f431
142142
refs/heads/autosynth-securitycenter: 1b300406bfc0f022d0ae98286c419d54d08d2ad4
143143
refs/heads/autosynth-spanner: 54521ca9d598aa2a8778ee11d153da558a38834e

branches/autosynth-redis/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)