Package com.google.cloud.spanner.spi.v1
Class GapicSpannerRpc
java.lang.Object
com.google.cloud.spanner.spi.v1.GapicSpannerRpc
- All Implemented Interfaces:
com.google.cloud.ServiceRpc,SpannerRpc
Implementation of Cloud Spanner remote calls using Gapic libraries.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.cloud.spanner.spi.v1.SpannerRpc
SpannerRpc.Option, SpannerRpc.Paginated<T>, SpannerRpc.ResultStreamConsumer, SpannerRpc.StreamingCall -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.core.ApiFuture<com.google.protobuf.Empty>asyncDeleteSession(String sessionName, Map<SpannerRpc.Option, ?> options) batchCreateSessions(String databaseName, int sessionCount, String databaseRole, Map<String, String> labels, Map<SpannerRpc.Option, ?> options) com.google.api.gax.rpc.ServerStream<BatchWriteResponse>batchWriteAtLeastOnce(BatchWriteRequest request, Map<SpannerRpc.Option, ?> options) beginTransaction(BeginTransactionRequest request, Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Begins a transaction.com.google.api.core.ApiFuture<Transaction>beginTransactionAsync(BeginTransactionRequest request, Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Begins a transaction asynchronously.voidcancelOperation(String name) Cancels the specified long-running operation.commit(CommitRequest commitRequest, Map<SpannerRpc.Option, ?> options) com.google.api.core.ApiFuture<CommitResponse>commitAsync(CommitRequest request, Map<SpannerRpc.Option, ?> options) com.google.api.gax.longrunning.OperationFuture<Backup,CopyBackupMetadata> copyBackup(BackupId sourceBackupId, Backup destinationBackup) Creates a copy backup from the source backup specified.static GapicSpannerRpccreate(SpannerOptions options) com.google.api.gax.longrunning.OperationFuture<Backup,CreateBackupMetadata> createBackup(Backup backupInfo) Creates a new backup from the source database specified in theBackupinstance.com.google.api.gax.longrunning.OperationFuture<Database,CreateDatabaseMetadata> createDatabase(String instanceName, String createDatabaseStatement, Iterable<String> additionalStatements, Database databaseInfo) com.google.api.gax.longrunning.OperationFuture<Instance,CreateInstanceMetadata> createInstance(String parent, String instanceId, Instance instance) com.google.api.gax.longrunning.OperationFuture<InstanceConfig,CreateInstanceConfigMetadata> createInstanceConfig(String parent, String instanceConfigId, InstanceConfig instanceConfig, Boolean validateOnly) createSession(String databaseName, String databaseRole, Map<String, String> labels, Map<SpannerRpc.Option, ?> options) createSession(String databaseName, String databaseRole, Map<String, String> labels, Map<SpannerRpc.Option, ?> options, boolean isMultiplexed) voiddeleteBackup(String backupName) Deletes a pending or completed backup.voiddeleteInstance(String instanceName) voiddeleteInstanceConfig(String instanceConfigName, String etag, Boolean validateOnly) voiddeleteSession(String sessionName, Map<SpannerRpc.Option, ?> options) voiddropDatabase(String databaseName) executeBatchDml(ExecuteBatchDmlRequest request, Map<SpannerRpc.Option, ?> options) com.google.api.core.ApiFuture<ExecuteBatchDmlResponse>executeBatchDmlAsync(ExecuteBatchDmlRequest request, Map<SpannerRpc.Option, ?> options) executePartitionedDml(ExecuteSqlRequest request, Map<SpannerRpc.Option, ?> options) executeQuery(ExecuteSqlRequest request, SpannerRpc.ResultStreamConsumer consumer, Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Executes a query with streaming result.executeQuery(ExecuteSqlRequest request, Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Executes a query.com.google.api.core.ApiFuture<ResultSet>executeQueryAsync(ExecuteSqlRequest request, Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Executes a query asynchronously.com.google.api.gax.rpc.ServerStream<PartialResultSet>executeStreamingPartitionedDml(ExecuteSqlRequest request, Map<SpannerRpc.Option, ?> options, org.threeten.bp.Duration timeout) Gets the backup with the specified name.com.google.api.gax.retrying.RetrySettingsgetDatabase(String databaseName) com.google.iam.v1.PolicygetDatabaseAdminIAMPolicy(String resource, com.google.iam.v1.GetPolicyOptions options) Gets the IAM policy for the given resource using theDatabaseAdminStub.Getter method to obtain the auto-generated database admin client stub settings.getDatabaseDdl(String databaseName) Set<com.google.api.gax.rpc.StatusCode.Code>Returns the retryable codes for streaming query operations.com.google.api.gax.retrying.RetrySettingsReturns the retry settings for streaming query operations.getInstance(String instanceName) com.google.iam.v1.PolicygetInstanceAdminIAMPolicy(String resource) Gets the IAM policy for the given resource using theInstanceAdminStub.Getter method to obtain the auto-generated instance admin client stub settings.getInstanceConfig(String instanceConfigName) intcom.google.longrunning.OperationgetOperation(String name) Retrieves a long running operation.com.google.api.gax.retrying.RetrySettingsSet<com.google.api.gax.rpc.StatusCode.Code>Returns the retryable codes for streaming read operations.com.google.api.gax.retrying.RetrySettingsReturns the retry settings for streaming read operations.booleanisClosed()SpannerRpc.Paginated<com.google.longrunning.Operation>listBackupOperations(String instanceName, int pageSize, String filter, String pageToken) List all long-running backup operations on the given instance.listBackups(String instanceName, int pageSize, String filter, String pageToken) Lists the backups in the specified instance.SpannerRpc.Paginated<com.google.longrunning.Operation>listDatabaseOperations(String instanceName, int pageSize, String filter, String pageToken) listDatabaseRoles(String databaseName, int pageSize, String pageToken) listDatabases(String instanceName, int pageSize, String pageToken) SpannerRpc.Paginated<com.google.longrunning.Operation>listInstanceConfigOperations(int pageSize, String filter, String pageToken) List all long-running instance config operations on the given project.listInstanceConfigs(int pageSize, String pageToken) listInstances(int pageSize, String pageToken, String filter) partitionQuery(PartitionQueryRequest request, Map<SpannerRpc.Option, ?> options) partitionRead(PartitionReadRequest request, Map<SpannerRpc.Option, ?> options) read(ReadRequest request, SpannerRpc.ResultStreamConsumer consumer, Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Performs a streaming read.com.google.api.gax.longrunning.OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabase(Restore restore) Restore a backup into the given database.voidrollback(RollbackRequest request, Map<SpannerRpc.Option, ?> options) com.google.api.core.ApiFuture<com.google.protobuf.Empty>rollbackAsync(RollbackRequest request, Map<SpannerRpc.Option, ?> options) com.google.iam.v1.PolicysetDatabaseAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy) Updates the IAM policy for the given resource using theDatabaseAdminStub.com.google.iam.v1.PolicysetInstanceAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy) Updates the IAM policy for the given resource using theInstanceAdminStub.voidshutdown()voidcom.google.iam.v1.TestIamPermissionsResponsetestDatabaseAdminIAMPermissions(String resource, Iterable<String> permissions) Tests the IAM permissions for the given resource using theDatabaseAdminStub.com.google.iam.v1.TestIamPermissionsResponsetestInstanceAdminIAMPermissions(String resource, Iterable<String> permissions) Tests the IAM permissions for the given resource using theInstanceAdminStub.updateBackup(Backup backup, com.google.protobuf.FieldMask updateMask) Updates the specified backup.com.google.api.gax.longrunning.OperationFuture<Database,UpdateDatabaseMetadata> updateDatabase(Database database, com.google.protobuf.FieldMask updateMask) Updates the specified fields of a Cloud Spanner database.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdl(Database databaseInfo, Iterable<String> updateDatabaseStatements, String updateId) If the update database ddl operation returns an ALREADY_EXISTS error, meaning the operation id used is already in flight, this method will simply resume the original operation.com.google.api.gax.longrunning.OperationFuture<Instance,UpdateInstanceMetadata> updateInstance(Instance instance, com.google.protobuf.FieldMask fieldMask) com.google.api.gax.longrunning.OperationFuture<InstanceConfig,UpdateInstanceConfigMetadata> updateInstanceConfig(InstanceConfig instanceConfig, Boolean validateOnly, com.google.protobuf.FieldMask fieldMask)
-
Field Details
-
DEFAULT_USER_AGENT
-
-
Constructor Details
-
GapicSpannerRpc
-
-
Method Details
-
create
-
listInstanceConfigs
public SpannerRpc.Paginated<InstanceConfig> listInstanceConfigs(int pageSize, @Nullable String pageToken) throws SpannerException - Specified by:
listInstanceConfigsin interfaceSpannerRpc- Throws:
SpannerException
-
createInstanceConfig
public com.google.api.gax.longrunning.OperationFuture<InstanceConfig,CreateInstanceConfigMetadata> createInstanceConfig(String parent, String instanceConfigId, InstanceConfig instanceConfig, @Nullable Boolean validateOnly) throws SpannerException - Specified by:
createInstanceConfigin interfaceSpannerRpc- Throws:
SpannerException
-
updateInstanceConfig
public com.google.api.gax.longrunning.OperationFuture<InstanceConfig,UpdateInstanceConfigMetadata> updateInstanceConfig(InstanceConfig instanceConfig, @Nullable Boolean validateOnly, com.google.protobuf.FieldMask fieldMask) throws SpannerException - Specified by:
updateInstanceConfigin interfaceSpannerRpc- Throws:
SpannerException
-
getInstanceConfig
- Specified by:
getInstanceConfigin interfaceSpannerRpc- Throws:
SpannerException
-
deleteInstanceConfig
public void deleteInstanceConfig(String instanceConfigName, @Nullable String etag, @Nullable Boolean validateOnly) throws SpannerException - Specified by:
deleteInstanceConfigin interfaceSpannerRpc- Throws:
SpannerException
-
listInstanceConfigOperations
public SpannerRpc.Paginated<com.google.longrunning.Operation> listInstanceConfigOperations(int pageSize, @Nullable String filter, @Nullable String pageToken) Description copied from interface:SpannerRpcList all long-running instance config operations on the given project.- Specified by:
listInstanceConfigOperationsin interfaceSpannerRpc
-
listInstances
public SpannerRpc.Paginated<Instance> listInstances(int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException - Specified by:
listInstancesin interfaceSpannerRpc- Throws:
SpannerException
-
createInstance
public com.google.api.gax.longrunning.OperationFuture<Instance,CreateInstanceMetadata> createInstance(String parent, String instanceId, Instance instance) throws SpannerException - Specified by:
createInstancein interfaceSpannerRpc- Throws:
SpannerException
-
updateInstance
public com.google.api.gax.longrunning.OperationFuture<Instance,UpdateInstanceMetadata> updateInstance(Instance instance, com.google.protobuf.FieldMask fieldMask) throws SpannerException - Specified by:
updateInstancein interfaceSpannerRpc- Throws:
SpannerException
-
getInstance
- Specified by:
getInstancein interfaceSpannerRpc- Throws:
SpannerException
-
deleteInstance
- Specified by:
deleteInstancein interfaceSpannerRpc- Throws:
SpannerException
-
listBackupOperations
public SpannerRpc.Paginated<com.google.longrunning.Operation> listBackupOperations(String instanceName, int pageSize, @Nullable String filter, @Nullable String pageToken) Description copied from interface:SpannerRpcList all long-running backup operations on the given instance.- Specified by:
listBackupOperationsin interfaceSpannerRpc
-
listDatabaseOperations
public SpannerRpc.Paginated<com.google.longrunning.Operation> listDatabaseOperations(String instanceName, int pageSize, @Nullable String filter, @Nullable String pageToken) - Specified by:
listDatabaseOperationsin interfaceSpannerRpc
-
listDatabaseRoles
public SpannerRpc.Paginated<DatabaseRole> listDatabaseRoles(String databaseName, int pageSize, @Nullable String pageToken) - Specified by:
listDatabaseRolesin interfaceSpannerRpc
-
listBackups
public SpannerRpc.Paginated<Backup> listBackups(String instanceName, int pageSize, @Nullable String filter, @Nullable String pageToken) throws SpannerException Description copied from interface:SpannerRpcLists the backups in the specified instance.- Specified by:
listBackupsin interfaceSpannerRpc- Throws:
SpannerException
-
listDatabases
public SpannerRpc.Paginated<Database> listDatabases(String instanceName, int pageSize, @Nullable String pageToken) throws SpannerException - Specified by:
listDatabasesin interfaceSpannerRpc- Throws:
SpannerException
-
createDatabase
public com.google.api.gax.longrunning.OperationFuture<Database,CreateDatabaseMetadata> createDatabase(String instanceName, String createDatabaseStatement, Iterable<String> additionalStatements, Database databaseInfo) throws SpannerException - Specified by:
createDatabasein interfaceSpannerRpc- Throws:
SpannerException
-
updateDatabaseDdl
public com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdl(Database databaseInfo, Iterable<String> updateDatabaseStatements, @Nullable String updateId) throws SpannerException If the update database ddl operation returns an ALREADY_EXISTS error, meaning the operation id used is already in flight, this method will simply resume the original operation. The returned future will be completed when the original operation finishes.This mechanism is necessary, because the update database ddl can be retried. If a retryable failure occurs, the backend has already started processing the update database ddl operation with the given id and the library issues a retry, an ALREADY_EXISTS error will be returned. If we were to bubble this error up, it would be confusing for the caller, who used originally called the method with a new operation id.
- Specified by:
updateDatabaseDdlin interfaceSpannerRpc- Throws:
SpannerException
-
dropDatabase
- Specified by:
dropDatabasein interfaceSpannerRpc- Throws:
SpannerException
-
getDatabase
- Specified by:
getDatabasein interfaceSpannerRpc- Throws:
SpannerException
-
updateDatabase
public com.google.api.gax.longrunning.OperationFuture<Database,UpdateDatabaseMetadata> updateDatabase(Database database, com.google.protobuf.FieldMask updateMask) throws SpannerException Description copied from interface:SpannerRpcUpdates the specified fields of a Cloud Spanner database.- Specified by:
updateDatabasein interfaceSpannerRpc- Parameters:
database- The database proto whose field values will be used as the new values in the stored database.updateMask- The fields to update. Currently, only the "enable_drop_protection" field of the database supports updates.- Returns:
- an `OperationFuture` that can be used to track the status of the update.
- Throws:
SpannerException
-
getDatabaseDdl
- Specified by:
getDatabaseDdlin interfaceSpannerRpc- Throws:
SpannerException
-
createBackup
public com.google.api.gax.longrunning.OperationFuture<Backup,CreateBackupMetadata> createBackup(Backup backupInfo) throws SpannerException Description copied from interface:SpannerRpcCreates a new backup from the source database specified in theBackupinstance.- Specified by:
createBackupin interfaceSpannerRpc- Parameters:
backupInfo- the backup to create. The instance, database and expireTime fields of the backup must be filled.- Returns:
- the operation that monitors the backup creation.
- Throws:
SpannerException
-
copyBackup
public com.google.api.gax.longrunning.OperationFuture<Backup,CopyBackupMetadata> copyBackup(BackupId sourceBackupId, Backup destinationBackup) throws SpannerException Description copied from interface:SpannerRpcCreates a copy backup from the source backup specified.- Specified by:
copyBackupin interfaceSpannerRpcdestinationBackup- 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.- Returns:
- the operation that monitors the backup creation.
- Throws:
SpannerException
-
restoreDatabase
public com.google.api.gax.longrunning.OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabase(Restore restore) Description copied from interface:SpannerRpcRestore a backup into the given database.- Specified by:
restoreDatabasein interfaceSpannerRpc- Parameters:
restore- aRestoreinstance with the backup source and destination database
-
updateBackup
Description copied from interface:SpannerRpcUpdates the specified backup. The only supported field for updates is expireTime.- Specified by:
updateBackupin interfaceSpannerRpc
-
deleteBackup
Description copied from interface:SpannerRpcDeletes a pending or completed backup.- Specified by:
deleteBackupin interfaceSpannerRpc- Parameters:
backupName- Required. The fully qualified name of the backup to delete.
-
getBackup
Description copied from interface:SpannerRpcGets the backup with the specified name.- Specified by:
getBackupin interfaceSpannerRpc- Throws:
SpannerException
-
getOperation
Description copied from interface:SpannerRpcRetrieves a long running operation.- Specified by:
getOperationin interfaceSpannerRpc- Throws:
SpannerException
-
cancelOperation
Description copied from interface:SpannerRpcCancels the specified long-running operation.- Specified by:
cancelOperationin interfaceSpannerRpc- Throws:
SpannerException
-
batchCreateSessions
public List<Session> batchCreateSessions(String databaseName, int sessionCount, @Nullable String databaseRole, @Nullable Map<String, String> labels, @Nullable Map<SpannerRpc.Option, throws SpannerException?> options) - Specified by:
batchCreateSessionsin interfaceSpannerRpc- Throws:
SpannerException
-
createSession
public Session createSession(String databaseName, @Nullable String databaseRole, @Nullable Map<String, String> labels, @Nullable Map<SpannerRpc.Option, throws SpannerException?> options) - Specified by:
createSessionin interfaceSpannerRpc- Throws:
SpannerException
-
createSession
public Session createSession(String databaseName, @Nullable String databaseRole, @Nullable Map<String, String> labels, @Nullable Map<SpannerRpc.Option, throws SpannerException?> options, boolean isMultiplexed) - Specified by:
createSessionin interfaceSpannerRpc- Throws:
SpannerException
-
deleteSession
public void deleteSession(String sessionName, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
deleteSessionin interfaceSpannerRpc- Throws:
SpannerException
-
asyncDeleteSession
public com.google.api.core.ApiFuture<com.google.protobuf.Empty> asyncDeleteSession(String sessionName, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
asyncDeleteSessionin interfaceSpannerRpc
-
getReadRetrySettings
public com.google.api.gax.retrying.RetrySettings getReadRetrySettings()Description copied from interface:SpannerRpcReturns the retry settings for streaming read operations.- Specified by:
getReadRetrySettingsin interfaceSpannerRpc
-
getReadRetryableCodes
Description copied from interface:SpannerRpcReturns the retryable codes for streaming read operations.- Specified by:
getReadRetryableCodesin interfaceSpannerRpc
-
read
public SpannerRpc.StreamingCall read(ReadRequest request, SpannerRpc.ResultStreamConsumer consumer, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpcPerforms a streaming read.- Specified by:
readin interfaceSpannerRpcrouteToLeader- Set to true to route the request to the leader region, and false to route the request to any region. When leader aware routing is enabled, RW/PDML requests are preferred to be routed to the leader region, and RO requests (except for PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
-
getExecuteQueryRetrySettings
public com.google.api.gax.retrying.RetrySettings getExecuteQueryRetrySettings()Description copied from interface:SpannerRpcReturns the retry settings for streaming query operations.- Specified by:
getExecuteQueryRetrySettingsin interfaceSpannerRpc
-
getExecuteQueryRetryableCodes
Description copied from interface:SpannerRpcReturns the retryable codes for streaming query operations.- Specified by:
getExecuteQueryRetryableCodesin interfaceSpannerRpc
-
executeQuery
public ResultSet executeQuery(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpcExecutes a query.- Specified by:
executeQueryin interfaceSpannerRpcrouteToLeader- Set to true to route the request to the leader region, and false to route the request to any region. When leader aware routing is enabled, RW/PDML requests are preferred to be routed to the leader region, and RO requests (except for PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
-
executeQueryAsync
public com.google.api.core.ApiFuture<ResultSet> executeQueryAsync(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpcExecutes a query asynchronously.- Specified by:
executeQueryAsyncin interfaceSpannerRpcrouteToLeader- Set to true to route the request to the leader region, and false to route the request to any region. When leader aware routing is enabled, RW/PDML requests are preferred to be routed to the leader region, and RO requests (except for PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
-
executePartitionedDml
public ResultSet executePartitionedDml(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
executePartitionedDmlin interfaceSpannerRpc
-
getPartitionedDmlRetrySettings
public com.google.api.gax.retrying.RetrySettings getPartitionedDmlRetrySettings()- Specified by:
getPartitionedDmlRetrySettingsin interfaceSpannerRpc
-
executeStreamingPartitionedDml
public com.google.api.gax.rpc.ServerStream<PartialResultSet> executeStreamingPartitionedDml(ExecuteSqlRequest request, Map<SpannerRpc.Option, ?> options, org.threeten.bp.Duration timeout) - Specified by:
executeStreamingPartitionedDmlin interfaceSpannerRpc
-
batchWriteAtLeastOnce
public com.google.api.gax.rpc.ServerStream<BatchWriteResponse> batchWriteAtLeastOnce(BatchWriteRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
batchWriteAtLeastOncein interfaceSpannerRpc
-
executeQuery
public SpannerRpc.StreamingCall executeQuery(ExecuteSqlRequest request, SpannerRpc.ResultStreamConsumer consumer, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpcExecutes a query with streaming result.- Specified by:
executeQueryin interfaceSpannerRpcrouteToLeader- Set to true to route the request to the leader region, and false to route the request to any region. When leader aware routing is enabled, RW/PDML requests are preferred to be routed to the leader region, and RO requests (except for PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
-
executeBatchDml
public ExecuteBatchDmlResponse executeBatchDml(ExecuteBatchDmlRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
executeBatchDmlin interfaceSpannerRpc
-
executeBatchDmlAsync
public com.google.api.core.ApiFuture<ExecuteBatchDmlResponse> executeBatchDmlAsync(ExecuteBatchDmlRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
executeBatchDmlAsyncin interfaceSpannerRpc
-
beginTransactionAsync
public com.google.api.core.ApiFuture<Transaction> beginTransactionAsync(BeginTransactionRequest request, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpcBegins a transaction asynchronously.- Specified by:
beginTransactionAsyncin interfaceSpannerRpcrouteToLeader- Set to true to route the request to the leader region, and false to route the request to any region. When leader aware routing is enabled, RW/PDML requests are preferred to be routed to the leader region, and RO requests (except for PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
-
beginTransaction
public Transaction beginTransaction(BeginTransactionRequest request, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) throws SpannerExceptionDescription copied from interface:SpannerRpcBegins a transaction.- Specified by:
beginTransactionin interfaceSpannerRpcrouteToLeader- Set to true to route the request to the leader region, and false to route the request to any region. When leader aware routing is enabled, RW/PDML requests are preferred to be routed to the leader region, and RO requests (except for PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.- Throws:
SpannerException
-
commitAsync
public com.google.api.core.ApiFuture<CommitResponse> commitAsync(CommitRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
commitAsyncin interfaceSpannerRpc
-
commit
public CommitResponse commit(CommitRequest commitRequest, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
commitin interfaceSpannerRpc- Throws:
SpannerException
-
getCommitRetrySettings
public com.google.api.gax.retrying.RetrySettings getCommitRetrySettings()- Specified by:
getCommitRetrySettingsin interfaceSpannerRpc
-
rollbackAsync
public com.google.api.core.ApiFuture<com.google.protobuf.Empty> rollbackAsync(RollbackRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
rollbackAsyncin interfaceSpannerRpc
-
rollback
public void rollback(RollbackRequest request, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
rollbackin interfaceSpannerRpc- Throws:
SpannerException
-
partitionQuery
public PartitionResponse partitionQuery(PartitionQueryRequest request, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
partitionQueryin interfaceSpannerRpc- Throws:
SpannerException
-
partitionRead
public PartitionResponse partitionRead(PartitionReadRequest request, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
partitionReadin interfaceSpannerRpc- Throws:
SpannerException
-
getDatabaseAdminIAMPolicy
public com.google.iam.v1.Policy getDatabaseAdminIAMPolicy(String resource, @Nullable com.google.iam.v1.GetPolicyOptions options) Description copied from interface:SpannerRpcGets the IAM policy for the given resource using theDatabaseAdminStub.- Specified by:
getDatabaseAdminIAMPolicyin interfaceSpannerRpc
-
setDatabaseAdminIAMPolicy
public com.google.iam.v1.Policy setDatabaseAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy) Description copied from interface:SpannerRpcUpdates the IAM policy for the given resource using theDatabaseAdminStub. It is highly recommended to first get the current policy and base the updated policy on the returned policy. SeePolicy.Builder.setEtag(com.google.protobuf.ByteString)for information on the recommended read-modify-write cycle.- Specified by:
setDatabaseAdminIAMPolicyin interfaceSpannerRpc
-
testDatabaseAdminIAMPermissions
public com.google.iam.v1.TestIamPermissionsResponse testDatabaseAdminIAMPermissions(String resource, Iterable<String> permissions) Description copied from interface:SpannerRpcTests the IAM permissions for the given resource using theDatabaseAdminStub.- Specified by:
testDatabaseAdminIAMPermissionsin interfaceSpannerRpc
-
getInstanceAdminIAMPolicy
Description copied from interface:SpannerRpcGets the IAM policy for the given resource using theInstanceAdminStub.- Specified by:
getInstanceAdminIAMPolicyin interfaceSpannerRpc
-
setInstanceAdminIAMPolicy
public com.google.iam.v1.Policy setInstanceAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy) Description copied from interface:SpannerRpcUpdates the IAM policy for the given resource using theInstanceAdminStub. It is highly recommended to first get the current policy and base the updated policy on the returned policy. SeePolicy.Builder.setEtag(com.google.protobuf.ByteString)for information on the recommended read-modify-write cycle.- Specified by:
setInstanceAdminIAMPolicyin interfaceSpannerRpc
-
testInstanceAdminIAMPermissions
public com.google.iam.v1.TestIamPermissionsResponse testInstanceAdminIAMPermissions(String resource, Iterable<String> permissions) Description copied from interface:SpannerRpcTests the IAM permissions for the given resource using theInstanceAdminStub.- Specified by:
testInstanceAdminIAMPermissionsin interfaceSpannerRpc
-
getNumActiveResponseObservers
@InternalApi public int getNumActiveResponseObservers() -
shutdown
public void shutdown()- Specified by:
shutdownin interfaceSpannerRpc
-
shutdownNow
public void shutdownNow() -
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceSpannerRpc
-
getDatabaseAdminStubSettings
Description copied from interface:SpannerRpcGetter method to obtain the auto-generated database admin client stub settings.- Specified by:
getDatabaseAdminStubSettingsin interfaceSpannerRpc- Returns:
- DatabaseAdminStubSettings
-
getInstanceAdminStubSettings
Description copied from interface:SpannerRpcGetter method to obtain the auto-generated instance admin client stub settings.- Specified by:
getInstanceAdminStubSettingsin interfaceSpannerRpc- Returns:
- InstanceAdminStubSettings
-