Skip to content

Commit

Permalink
Spanner: fix code formatting (#4105)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihanzhen authored and chingor13 committed Nov 27, 2018
1 parent 5f29ea2 commit b959329
Showing 1 changed file with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public OperationFuture<Database, CreateDatabaseMetadata> createDatabase(
String createStatement = "CREATE DATABASE `" + databaseId + "`";
OperationFuture<com.google.spanner.admin.database.v1.Database, CreateDatabaseMetadata>
rawOperationFuture = rpc.createDatabase(instanceName, createStatement, statements);
return new OperationFutureImpl(
return new OperationFutureImpl<Database, CreateDatabaseMetadata>(
rawOperationFuture.getPollingFuture(),
rawOperationFuture.getInitialFuture(),
new ApiFunction<OperationSnapshot, Database>() {
Expand Down Expand Up @@ -498,19 +498,20 @@ public OperationFuture<Void, UpdateDatabaseDdlMetadata> updateDatabaseDdl(
final String opId = operationId != null ? operationId : randomOperationId();
OperationFuture<Empty, UpdateDatabaseDdlMetadata> rawOperationFuture =
rpc.updateDatabaseDdl(dbName, statements, opId);
return new OperationFutureImpl(
return new OperationFutureImpl<Void, UpdateDatabaseDdlMetadata>(
rawOperationFuture.getPollingFuture(),
rawOperationFuture.getInitialFuture(),
new ApiFunction<OperationSnapshot, Void>() {
@Override
public Void apply(OperationSnapshot snapshot) {
ProtoOperationTransformers.ResponseTransformer.create(Empty.class).apply(snapshot);
return null;
}
},
ProtoOperationTransformers.MetadataTransformer.create(UpdateDatabaseDdlMetadata.class),
new ApiFunction<Exception, Database>() {
new ApiFunction<Exception, Void>() {
@Override
public Database apply(Exception e) {
public Void apply(Exception e) {
throw SpannerExceptionFactory.newSpannerException(e);
}
});
Expand Down Expand Up @@ -799,12 +800,12 @@ public Timestamp writeAtLeastOnce(Iterable<Mutation> mutations) throws SpannerEx
Mutation.toProto(mutations, mutationsProto);
final CommitRequest request =
CommitRequest.newBuilder()
.setSession(name)
.addAllMutations(mutationsProto)
.setSingleUseTransaction(
TransactionOptions.newBuilder()
.setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()))
.build();
.setSession(name)
.addAllMutations(mutationsProto)
.setSingleUseTransaction(
TransactionOptions.newBuilder()
.setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()))
.build();
Span span = tracer.spanBuilder(COMMIT).startSpan();
try (Scope s = tracer.withSpan(span)) {
CommitResponse response =
Expand Down Expand Up @@ -894,11 +895,11 @@ ByteString beginTransaction() {
try (Scope s = tracer.withSpan(span)) {
final BeginTransactionRequest request =
BeginTransactionRequest.newBuilder()
.setSession(name)
.setOptions(
TransactionOptions.newBuilder()
.setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()))
.build();
.setSession(name)
.setOptions(
TransactionOptions.newBuilder()
.setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()))
.build();
Transaction txn =
runWithRetries(
new Callable<Transaction>() {
Expand Down Expand Up @@ -1103,7 +1104,7 @@ CloseableIterator<PartialResultSet> startStream(@Nullable ByteString resumeToken
}
};
return new GrpcResultSet(stream, this, queryMode);
}
}

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

/**
Expand Down Expand Up @@ -2792,7 +2793,7 @@ ResultSetMetadata getMetadata() throws SpannerException {
* results will return null.
*/
@Nullable
ResultSetStats getStats() {
ResultSetStats getStats() {
return statistics;
}

Expand Down

0 comments on commit b959329

Please sign in to comment.