public interface SpannerRpc
extends com.google.cloud.ServiceRpc
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.
Modifier and Type | Interface and Description |
---|---|
static class |
SpannerRpc.Option
Options passed in
SpannerRpc methods to control how an RPC is issued. |
static class |
SpannerRpc.Paginated<T>
Represents results from paginated RPCs, i.e., those where up to a maximum number of items is
returned from each call and a followup call must be made to fetch more.
|
static interface |
SpannerRpc.ResultStreamConsumer
Consumer for the results produced by a streaming read or query call.
|
static interface |
SpannerRpc.StreamingCall
Handle for cancellation of a streaming read or query call.
|
Modifier and Type | Method and Description |
---|---|
List<Session> |
batchCreateSessions(String databaseName,
int sessionCount,
Map<String,String> labels,
Map<SpannerRpc.Option,?> options) |
Transaction |
beginTransaction(BeginTransactionRequest request,
Map<SpannerRpc.Option,?> options) |
CommitResponse |
commit(CommitRequest commitRequest,
Map<SpannerRpc.Option,?> options) |
com.google.api.gax.longrunning.OperationFuture<Database,CreateDatabaseMetadata> |
createDatabase(String instanceName,
String createDatabaseStatement,
Iterable<String> additionalStatements) |
com.google.api.gax.longrunning.OperationFuture<Instance,CreateInstanceMetadata> |
createInstance(String parent,
String instanceId,
Instance instance) |
Session |
createSession(String databaseName,
Map<String,String> labels,
Map<SpannerRpc.Option,?> options) |
void |
deleteInstance(String instanceName) |
void |
deleteSession(String sessionName,
Map<SpannerRpc.Option,?> options) |
void |
dropDatabase(String databaseName) |
ExecuteBatchDmlResponse |
executeBatchDml(ExecuteBatchDmlRequest build,
Map<SpannerRpc.Option,?> options) |
ResultSet |
executePartitionedDml(ExecuteSqlRequest request,
Map<SpannerRpc.Option,?> options,
org.threeten.bp.Duration timeout) |
ResultSet |
executeQuery(ExecuteSqlRequest request,
Map<SpannerRpc.Option,?> options) |
SpannerRpc.StreamingCall |
executeQuery(ExecuteSqlRequest request,
SpannerRpc.ResultStreamConsumer consumer,
Map<SpannerRpc.Option,?> options) |
Database |
getDatabase(String databaseName) |
com.google.iam.v1.Policy |
getDatabaseAdminIAMPolicy(String resource)
Gets the IAM policy for the given resource using the
DatabaseAdminStub . |
List<String> |
getDatabaseDdl(String databaseName) |
Instance |
getInstance(String instanceName) |
com.google.iam.v1.Policy |
getInstanceAdminIAMPolicy(String resource)
Gets the IAM policy for the given resource using the
InstanceAdminStub . |
InstanceConfig |
getInstanceConfig(String instanceConfigName) |
com.google.longrunning.Operation |
getOperation(String name)
Retrieves a long running operation.
|
boolean |
isClosed() |
SpannerRpc.Paginated<Database> |
listDatabases(String instanceName,
int pageSize,
String pageToken) |
SpannerRpc.Paginated<InstanceConfig> |
listInstanceConfigs(int pageSize,
String pageToken) |
SpannerRpc.Paginated<Instance> |
listInstances(int pageSize,
String pageToken,
String filter) |
PartitionResponse |
partitionQuery(PartitionQueryRequest request,
Map<SpannerRpc.Option,?> options) |
PartitionResponse |
partitionRead(PartitionReadRequest request,
Map<SpannerRpc.Option,?> options) |
SpannerRpc.StreamingCall |
read(ReadRequest request,
SpannerRpc.ResultStreamConsumer consumer,
Map<SpannerRpc.Option,?> options) |
void |
rollback(RollbackRequest request,
Map<SpannerRpc.Option,?> options) |
com.google.iam.v1.Policy |
setDatabaseAdminIAMPolicy(String resource,
com.google.iam.v1.Policy policy)
Updates the IAM policy for the given resource using the
DatabaseAdminStub . |
com.google.iam.v1.Policy |
setInstanceAdminIAMPolicy(String resource,
com.google.iam.v1.Policy policy)
Updates the IAM policy for the given resource using the
InstanceAdminStub . |
void |
shutdown() |
com.google.iam.v1.TestIamPermissionsResponse |
testDatabaseAdminIAMPermissions(String resource,
Iterable<String> permissions)
Tests the IAM permissions for the given resource using the
DatabaseAdminStub . |
com.google.iam.v1.TestIamPermissionsResponse |
testInstanceAdminIAMPermissions(String resource,
Iterable<String> permissions)
Tests the IAM permissions for the given resource using the
InstanceAdminStub . |
com.google.api.gax.longrunning.OperationFuture<Empty,UpdateDatabaseDdlMetadata> |
updateDatabaseDdl(String databaseName,
Iterable<String> updateDatabaseStatements,
String updateId) |
com.google.api.gax.longrunning.OperationFuture<Instance,UpdateInstanceMetadata> |
updateInstance(Instance instance,
FieldMask fieldMask) |
SpannerRpc.Paginated<InstanceConfig> listInstanceConfigs(int pageSize, @Nullable String pageToken) throws SpannerException
SpannerException
InstanceConfig getInstanceConfig(String instanceConfigName) throws SpannerException
SpannerException
SpannerRpc.Paginated<Instance> listInstances(int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException
SpannerException
com.google.api.gax.longrunning.OperationFuture<Instance,CreateInstanceMetadata> createInstance(String parent, String instanceId, Instance instance) throws SpannerException
SpannerException
com.google.api.gax.longrunning.OperationFuture<Instance,UpdateInstanceMetadata> updateInstance(Instance instance, FieldMask fieldMask) throws SpannerException
SpannerException
Instance getInstance(String instanceName) throws SpannerException
SpannerException
void deleteInstance(String instanceName) throws SpannerException
SpannerException
SpannerRpc.Paginated<Database> listDatabases(String instanceName, int pageSize, @Nullable String pageToken) throws SpannerException
SpannerException
com.google.api.gax.longrunning.OperationFuture<Database,CreateDatabaseMetadata> createDatabase(String instanceName, String createDatabaseStatement, Iterable<String> additionalStatements) throws SpannerException
SpannerException
com.google.api.gax.longrunning.OperationFuture<Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdl(String databaseName, Iterable<String> updateDatabaseStatements, @Nullable String updateId) throws SpannerException
SpannerException
void dropDatabase(String databaseName) throws SpannerException
SpannerException
Database getDatabase(String databaseName) throws SpannerException
SpannerException
List<String> getDatabaseDdl(String databaseName) throws SpannerException
SpannerException
com.google.longrunning.Operation getOperation(String name) throws SpannerException
SpannerException
List<Session> batchCreateSessions(String databaseName, int sessionCount, @Nullable Map<String,String> labels, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
Session createSession(String databaseName, @Nullable Map<String,String> labels, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
void deleteSession(String sessionName, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
SpannerRpc.StreamingCall read(ReadRequest request, SpannerRpc.ResultStreamConsumer consumer, @Nullable Map<SpannerRpc.Option,?> options)
ResultSet executeQuery(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option,?> options)
ResultSet executePartitionedDml(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option,?> options, org.threeten.bp.Duration timeout)
SpannerRpc.StreamingCall executeQuery(ExecuteSqlRequest request, SpannerRpc.ResultStreamConsumer consumer, @Nullable Map<SpannerRpc.Option,?> options)
ExecuteBatchDmlResponse executeBatchDml(ExecuteBatchDmlRequest build, Map<SpannerRpc.Option,?> options)
Transaction beginTransaction(BeginTransactionRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
CommitResponse commit(CommitRequest commitRequest, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
void rollback(RollbackRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
PartitionResponse partitionQuery(PartitionQueryRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
PartitionResponse partitionRead(PartitionReadRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
com.google.iam.v1.Policy getDatabaseAdminIAMPolicy(String resource)
DatabaseAdminStub
.com.google.iam.v1.Policy setDatabaseAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy)
DatabaseAdminStub
. It is highly
recommended to first get the current policy and base the updated policy on the returned policy.
See Policy.Builder#setEtag(com.google.protobuf.ByteString)
for information on the
recommended read-modify-write cycle.com.google.iam.v1.TestIamPermissionsResponse testDatabaseAdminIAMPermissions(String resource, Iterable<String> permissions)
DatabaseAdminStub
.com.google.iam.v1.Policy getInstanceAdminIAMPolicy(String resource)
InstanceAdminStub
.com.google.iam.v1.Policy setInstanceAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy)
InstanceAdminStub
. It is highly
recommended to first get the current policy and base the updated policy on the returned policy.
See Policy.Builder#setEtag(com.google.protobuf.ByteString)
for information on the
recommended read-modify-write cycle.com.google.iam.v1.TestIamPermissionsResponse testInstanceAdminIAMPermissions(String resource, Iterable<String> permissions)
InstanceAdminStub
.void shutdown()
boolean isClosed()
Copyright © 2019 Google LLC. All rights reserved.