Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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 @@ -78,6 +78,65 @@ private SpannerGrpc() {}
return getCreateSessionMethod;
}

@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
@java.lang.Deprecated // Use {@link #getBatchCreateSessionsMethod()} instead.
public static final io.grpc.MethodDescriptor<
com.google.spanner.v1.BatchCreateSessionsRequest,
com.google.spanner.v1.BatchCreateSessionsResponse>
METHOD_BATCH_CREATE_SESSIONS = getBatchCreateSessionsMethodHelper();

private static volatile io.grpc.MethodDescriptor<
com.google.spanner.v1.BatchCreateSessionsRequest,
com.google.spanner.v1.BatchCreateSessionsResponse>
getBatchCreateSessionsMethod;

@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static io.grpc.MethodDescriptor<
com.google.spanner.v1.BatchCreateSessionsRequest,
com.google.spanner.v1.BatchCreateSessionsResponse>
getBatchCreateSessionsMethod() {
return getBatchCreateSessionsMethodHelper();
}

private static io.grpc.MethodDescriptor<
com.google.spanner.v1.BatchCreateSessionsRequest,
com.google.spanner.v1.BatchCreateSessionsResponse>
getBatchCreateSessionsMethodHelper() {
io.grpc.MethodDescriptor<
com.google.spanner.v1.BatchCreateSessionsRequest,
com.google.spanner.v1.BatchCreateSessionsResponse>
getBatchCreateSessionsMethod;
if ((getBatchCreateSessionsMethod = SpannerGrpc.getBatchCreateSessionsMethod) == null) {
synchronized (SpannerGrpc.class) {
if ((getBatchCreateSessionsMethod = SpannerGrpc.getBatchCreateSessionsMethod) == null) {
SpannerGrpc.getBatchCreateSessionsMethod =
getBatchCreateSessionsMethod =
io.grpc.MethodDescriptor
.<com.google.spanner.v1.BatchCreateSessionsRequest,
com.google.spanner.v1.BatchCreateSessionsResponse>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(
"google.spanner.v1.Spanner", "BatchCreateSessions"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.spanner.v1.BatchCreateSessionsRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.spanner.v1.BatchCreateSessionsResponse
.getDefaultInstance()))
.setSchemaDescriptor(
new SpannerMethodDescriptorSupplier("BatchCreateSessions"))
.build();
}
}
}
return getBatchCreateSessionsMethod;
}

@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
@java.lang.Deprecated // Use {@link #getGetSessionMethod()} instead.
public static final io.grpc.MethodDescriptor<
Expand Down Expand Up @@ -780,6 +839,22 @@ public void createSession(
asyncUnimplementedUnaryCall(getCreateSessionMethodHelper(), responseObserver);
}

/**
*
*
* <pre>
* Creates multiple new sessions.
* This API can be used to initialize a session cache on the clients.
* See https://goo.gl/TgSFN2 for best practices on session cache management.
* </pre>
*/
public void batchCreateSessions(
com.google.spanner.v1.BatchCreateSessionsRequest request,
io.grpc.stub.StreamObserver<com.google.spanner.v1.BatchCreateSessionsResponse>
responseObserver) {
asyncUnimplementedUnaryCall(getBatchCreateSessionsMethodHelper(), responseObserver);
}

/**
*
*
Expand Down Expand Up @@ -872,8 +947,9 @@ public void executeStreamingSql(
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
* Statements are executed in order, sequentially.
* [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse] will contain a
* [ResultSet][google.spanner.v1.ResultSet] for each DML statement that has successfully executed. If a
* statement fails, its error status will be returned as part of the
* [ResultSet][google.spanner.v1.ResultSet] for each DML statement that has
* successfully executed. If a statement fails, its error status will be
* returned as part of the
* [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse]. Execution will
* stop at the first failed statement; the remaining statements will not run.
* ExecuteBatchDml is expected to return an OK status with a response even if
Expand Down Expand Up @@ -1046,6 +1122,13 @@ public final io.grpc.ServerServiceDefinition bindService() {
new MethodHandlers<
com.google.spanner.v1.CreateSessionRequest, com.google.spanner.v1.Session>(
this, METHODID_CREATE_SESSION)))
.addMethod(
getBatchCreateSessionsMethodHelper(),
asyncUnaryCall(
new MethodHandlers<
com.google.spanner.v1.BatchCreateSessionsRequest,
com.google.spanner.v1.BatchCreateSessionsResponse>(
this, METHODID_BATCH_CREATE_SESSIONS)))
.addMethod(
getGetSessionMethodHelper(),
asyncUnaryCall(
Expand Down Expand Up @@ -1184,6 +1267,25 @@ public void createSession(
responseObserver);
}

/**
*
*
* <pre>
* Creates multiple new sessions.
* This API can be used to initialize a session cache on the clients.
* See https://goo.gl/TgSFN2 for best practices on session cache management.
* </pre>
*/
public void batchCreateSessions(
com.google.spanner.v1.BatchCreateSessionsRequest request,
io.grpc.stub.StreamObserver<com.google.spanner.v1.BatchCreateSessionsResponse>
responseObserver) {
asyncUnaryCall(
getChannel().newCall(getBatchCreateSessionsMethodHelper(), getCallOptions()),
request,
responseObserver);
}

/**
*
*
Expand Down Expand Up @@ -1291,8 +1393,9 @@ public void executeStreamingSql(
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
* Statements are executed in order, sequentially.
* [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse] will contain a
* [ResultSet][google.spanner.v1.ResultSet] for each DML statement that has successfully executed. If a
* statement fails, its error status will be returned as part of the
* [ResultSet][google.spanner.v1.ResultSet] for each DML statement that has
* successfully executed. If a statement fails, its error status will be
* returned as part of the
* [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse]. Execution will
* stop at the first failed statement; the remaining statements will not run.
* ExecuteBatchDml is expected to return an OK status with a response even if
Expand Down Expand Up @@ -1531,6 +1634,21 @@ public com.google.spanner.v1.Session createSession(
getChannel(), getCreateSessionMethodHelper(), getCallOptions(), request);
}

/**
*
*
* <pre>
* Creates multiple new sessions.
* This API can be used to initialize a session cache on the clients.
* See https://goo.gl/TgSFN2 for best practices on session cache management.
* </pre>
*/
public com.google.spanner.v1.BatchCreateSessionsResponse batchCreateSessions(
com.google.spanner.v1.BatchCreateSessionsRequest request) {
return blockingUnaryCall(
getChannel(), getBatchCreateSessionsMethodHelper(), getCallOptions(), request);
}

/**
*
*
Expand Down Expand Up @@ -1623,8 +1741,9 @@ public java.util.Iterator<com.google.spanner.v1.PartialResultSet> executeStreami
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
* Statements are executed in order, sequentially.
* [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse] will contain a
* [ResultSet][google.spanner.v1.ResultSet] for each DML statement that has successfully executed. If a
* statement fails, its error status will be returned as part of the
* [ResultSet][google.spanner.v1.ResultSet] for each DML statement that has
* successfully executed. If a statement fails, its error status will be
* returned as part of the
* [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse]. Execution will
* stop at the first failed statement; the remaining statements will not run.
* ExecuteBatchDml is expected to return an OK status with a response even if
Expand Down Expand Up @@ -1834,6 +1953,22 @@ protected SpannerFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c
getChannel().newCall(getCreateSessionMethodHelper(), getCallOptions()), request);
}

/**
*
*
* <pre>
* Creates multiple new sessions.
* This API can be used to initialize a session cache on the clients.
* See https://goo.gl/TgSFN2 for best practices on session cache management.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.spanner.v1.BatchCreateSessionsResponse>
batchCreateSessions(com.google.spanner.v1.BatchCreateSessionsRequest request) {
return futureUnaryCall(
getChannel().newCall(getBatchCreateSessionsMethodHelper(), getCallOptions()), request);
}

/**
*
*
Expand Down Expand Up @@ -1910,8 +2045,9 @@ protected SpannerFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
* Statements are executed in order, sequentially.
* [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse] will contain a
* [ResultSet][google.spanner.v1.ResultSet] for each DML statement that has successfully executed. If a
* statement fails, its error status will be returned as part of the
* [ResultSet][google.spanner.v1.ResultSet] for each DML statement that has
* successfully executed. If a statement fails, its error status will be
* returned as part of the
* [ExecuteBatchDmlResponse][Spanner.ExecuteBatchDmlResponse]. Execution will
* stop at the first failed statement; the remaining statements will not run.
* ExecuteBatchDml is expected to return an OK status with a response even if
Expand Down Expand Up @@ -2062,19 +2198,20 @@ public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Em
}

private static final int METHODID_CREATE_SESSION = 0;
private static final int METHODID_GET_SESSION = 1;
private static final int METHODID_LIST_SESSIONS = 2;
private static final int METHODID_DELETE_SESSION = 3;
private static final int METHODID_EXECUTE_SQL = 4;
private static final int METHODID_EXECUTE_STREAMING_SQL = 5;
private static final int METHODID_EXECUTE_BATCH_DML = 6;
private static final int METHODID_READ = 7;
private static final int METHODID_STREAMING_READ = 8;
private static final int METHODID_BEGIN_TRANSACTION = 9;
private static final int METHODID_COMMIT = 10;
private static final int METHODID_ROLLBACK = 11;
private static final int METHODID_PARTITION_QUERY = 12;
private static final int METHODID_PARTITION_READ = 13;
private static final int METHODID_BATCH_CREATE_SESSIONS = 1;
private static final int METHODID_GET_SESSION = 2;
private static final int METHODID_LIST_SESSIONS = 3;
private static final int METHODID_DELETE_SESSION = 4;
private static final int METHODID_EXECUTE_SQL = 5;
private static final int METHODID_EXECUTE_STREAMING_SQL = 6;
private static final int METHODID_EXECUTE_BATCH_DML = 7;
private static final int METHODID_READ = 8;
private static final int METHODID_STREAMING_READ = 9;
private static final int METHODID_BEGIN_TRANSACTION = 10;
private static final int METHODID_COMMIT = 11;
private static final int METHODID_ROLLBACK = 12;
private static final int METHODID_PARTITION_QUERY = 13;
private static final int METHODID_PARTITION_READ = 14;

private static final class MethodHandlers<Req, Resp>
implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
Expand All @@ -2098,6 +2235,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserv
(com.google.spanner.v1.CreateSessionRequest) request,
(io.grpc.stub.StreamObserver<com.google.spanner.v1.Session>) responseObserver);
break;
case METHODID_BATCH_CREATE_SESSIONS:
serviceImpl.batchCreateSessions(
(com.google.spanner.v1.BatchCreateSessionsRequest) request,
(io.grpc.stub.StreamObserver<com.google.spanner.v1.BatchCreateSessionsResponse>)
responseObserver);
break;
case METHODID_GET_SESSION:
serviceImpl.getSession(
(com.google.spanner.v1.GetSessionRequest) request,
Expand Down Expand Up @@ -2232,6 +2375,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new SpannerFileDescriptorSupplier())
.addMethod(getCreateSessionMethodHelper())
.addMethod(getBatchCreateSessionsMethodHelper())
.addMethod(getGetSessionMethodHelper())
.addMethod(getListSessionsMethodHelper())
.addMethod(getDeleteSessionMethodHelper())
Expand Down
Loading