Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spanner: format fixes #4105

Merged
merged 1 commit into from
Nov 27, 2018
Merged
Changes from all commits
Commits
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 @@ -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