Skip to content

Commit d2ccf35

Browse files
yihanzhenchingor13
authored andcommitted
---
yaml --- r: 12325 b: refs/heads/autosynth-securitycenter c: b959329 h: refs/heads/master i: 12323: c19eef1
1 parent 8ace04b commit d2ccf35

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

  • branches/autosynth-securitycenter/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
@@ -139,7 +139,7 @@ refs/heads/autosynth-language: 8972866b016473559702424205ce5569de47b34d
139139
refs/heads/autosynth-os-login: daa910328b954bbe87068f684a3088ed910f1ddf
140140
refs/heads/autosynth-redis: 4c68cb0fbc599124e717ab3f24bd8a8a5d085ca9
141141
refs/heads/autosynth-scheduler: efd0edcd8fc21ccea9b4ffb0e0c4949ee04115aa
142-
refs/heads/autosynth-securitycenter: 5f29ea236c301f33e4d40bd0acb1718e03b54ba9
142+
refs/heads/autosynth-securitycenter: b9593290347854a2c793eab4490a6a05ee8d9338
143143
refs/heads/autosynth-spanner: 54521ca9d598aa2a8778ee11d153da558a38834e
144144
refs/heads/autosynth-speech: 60c3d2d3d3ad49800884d6ef6eb4be1e09c0c020
145145
refs/heads/autosynth-tasks: 69be7c7aa2f85dd651c7ec2120d9227096fe11b0

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