@InternalApi
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.
|
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
OperationFuture<Instance,CreateInstanceMetadata> createInstance(String parent, String instanceId, Instance instance) throws SpannerException
SpannerException
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
OperationFuture<Database,CreateDatabaseMetadata> createDatabase(String instanceName, String createDatabaseStatement, Iterable<String> additionalStatements, Database database) throws SpannerException
SpannerException
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
SpannerRpc.Paginated<Backup> listBackups(String instanceName, int pageSize, @Nullable String filter, @Nullable String pageToken) throws SpannerException
SpannerException
OperationFuture<Backup,CreateBackupMetadata> createBackup(Backup backupInfo) throws SpannerException
Backup
instance.backupInfo
- the backup to create. The instance, database and expireTime fields of the
backup must be filled.SpannerException
default OperationFuture<Backup,CopyBackupMetadata> copyBackup(BackupId sourceBackupId, Backup destinationBackup)
destinationBackup
- the backup to create. The instance, database, and expireTime fields of
the backup must be filled. It may also optionally have an encryption config set. If no
encryption config has been set, the new backup will use the same encryption config as the
source backup.OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabase(Restore restore)
restore
- a Restore
instance with the backup source and destination databaseBackup getBackup(String backupName) throws SpannerException
SpannerException
Backup updateBackup(Backup backup, FieldMask updateMask)
SpannerRpc.Paginated<Operation> listBackupOperations(String instanceName, int pageSize, @Nullable String filter, @Nullable String pageToken)
void deleteBackup(String backupName)
backupName
- Required. The fully qualified name of the backup to delete.SpannerRpc.Paginated<Operation> listDatabaseOperations(String instanceName, int pageSize, @Nullable String filter, @Nullable String pageToken)
Operation getOperation(String name) throws SpannerException
SpannerException
void cancelOperation(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
com.google.api.core.ApiFuture<Empty> asyncDeleteSession(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)
com.google.api.core.ApiFuture<ResultSet> executeQueryAsync(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option,?> options)
ResultSet executePartitionedDml(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option,?> options)
RetrySettings getPartitionedDmlRetrySettings()
ServerStream<PartialResultSet> executeStreamingPartitionedDml(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)
com.google.api.core.ApiFuture<ExecuteBatchDmlResponse> executeBatchDmlAsync(ExecuteBatchDmlRequest build, Map<SpannerRpc.Option,?> options)
Transaction beginTransaction(BeginTransactionRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
com.google.api.core.ApiFuture<Transaction> beginTransactionAsync(BeginTransactionRequest request, @Nullable Map<SpannerRpc.Option,?> options)
CommitResponse commit(CommitRequest commitRequest, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
com.google.api.core.ApiFuture<CommitResponse> commitAsync(CommitRequest commitRequest, @Nullable Map<SpannerRpc.Option,?> options)
void rollback(RollbackRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
SpannerException
com.google.api.core.ApiFuture<Empty> rollbackAsync(RollbackRequest request, @Nullable Map<SpannerRpc.Option,?> options)
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 © 2022 Google LLC. All rights reserved.