public interface SpannerRpc extends ServiceRpc
Abstracts remote calls to the Cloud Spanner service. Typically end-consumer code will never use this interface; it's main purpose is to abstract the implementation of the public Cloud Spanner API from the underlying transport mechanism.
Each SpannerRPC
instance is bound to a particular project and set of authorization
credentials.
The interface is currently defined in terms of the generated HTTP client model classes. This is purely for expedience; a future version of this interface is likely to be independent of transport to allow switching between gRPC and HTTP.
Implements
com.google.cloud.ServiceRpcMethods
asyncDeleteSession(String sessionName, Map<SpannerRpc.Option,?> options)
public abstract ApiFuture<Empty> asyncDeleteSession(String sessionName, Map<SpannerRpc.Option,?> options)
Parameters | |
---|---|
Name | Description |
sessionName |
String |
options |
Map<Option,?> |
Returns | |
---|---|
Type | Description |
ApiFuture<Empty> |
Exceptions | |
---|---|
Type | Description |
SpannerException |
batchCreateSessions(String databaseName, int sessionCount, String databaseRole, Map<String,String> labels, Map<SpannerRpc.Option,?> options)
public abstract List<Session> batchCreateSessions(String databaseName, int sessionCount, String databaseRole, Map<String,String> labels, Map<SpannerRpc.Option,?> options)
Parameters | |
---|---|
Name | Description |
databaseName |
String |
sessionCount |
int |
databaseRole |
String |
labels |
Map<String,String> |
options |
Map<Option,?> |
Returns | |
---|---|
Type | Description |
List<Session> |
Exceptions | |
---|---|
Type | Description |
SpannerException |
batchWriteAtLeastOnce(BatchWriteRequest request, Map<SpannerRpc.Option,?> options)
public abstract ServerStream<BatchWriteResponse> batchWriteAtLeastOnce(BatchWriteRequest request, Map<SpannerRpc.Option,?> options)
Parameters | |
---|---|
Name | Description |
request |
BatchWriteRequest |
options |
Map<Option,?> |
Returns | |
---|---|
Type | Description |
ServerStream<BatchWriteResponse> |
beginTransaction(BeginTransactionRequest request, Map<SpannerRpc.Option,?> options, boolean routeToLeader)
public abstract Transaction beginTransaction(BeginTransactionRequest request, Map<SpannerRpc.Option,?> options, boolean routeToLeader)
Begins a transaction.
Parameters | |
---|---|
Name | Description |
request |
BeginTransactionRequest |
options |
Map<Option,?> |
routeToLeader < |