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
-
Constructor Summary
-
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.void
cancelOperation
(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 GapicSpannerRpc
create
(SpannerOptions options) com.google.api.gax.longrunning.OperationFuture<Backup,
CreateBackupMetadata> createBackup
(Backup backupInfo) Creates a new backup from the source database specified in theBackup
instance.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) void
deleteBackup
(String backupName) Deletes a pending or completed backup.void
deleteInstance
(String instanceName) void
deleteInstanceConfig
(String instanceConfigName, String etag, Boolean validateOnly) void
deleteSession
(String sessionName, Map<SpannerRpc.Option, ?> options) void
dropDatabase
(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.getDatabase
(String databaseName) com.google.iam.v1.Policy
getDatabaseAdminIAMPolicy
(String resource, com.google.iam.v1.GetPolicyOptions options) Gets the IAM policy for the given resource using theDatabaseAdminStub
.getDatabaseDdl
(String databaseName) Set<com.google.api.gax.rpc.StatusCode.Code>
Returns the retryable codes for streaming query operations.com.google.api.gax.retrying.RetrySettings
Returns the retry settings for streaming query operations.getInstance
(String instanceName) com.google.iam.v1.Policy
getInstanceAdminIAMPolicy
(String resource) Gets the IAM policy for the given resource using theInstanceAdminStub
.getInstanceConfig
(String instanceConfigName) com.google.longrunning.Operation
getOperation
(String name) Retrieves a long running operation.com.google.api.gax.retrying.RetrySettings
Set<com.google.api.gax.rpc.StatusCode.Code>
Returns the retryable codes for streaming read operations.com.google.api.gax.retrying.RetrySettings
Returns the retry settings for streaming read operations.boolean
isClosed()
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.void
rollback
(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.Policy
setDatabaseAdminIAMPolicy
(String resource, com.google.iam.v1.Policy policy) Updates the IAM policy for the given resource using theDatabaseAdminStub
.com.google.iam.v1.Policy
setInstanceAdminIAMPolicy
(String resource, com.google.iam.v1.Policy policy) Updates the IAM policy for the given resource using theInstanceAdminStub
.void
shutdown()
void
com.google.iam.v1.TestIamPermissionsResponse
testDatabaseAdminIAMPermissions
(String resource, Iterable<String> permissions) Tests the IAM permissions for the given resource using theDatabaseAdminStub
.com.google.iam.v1.TestIamPermissionsResponse
testInstanceAdminIAMPermissions
(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
(String databaseName, 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:
listInstanceConfigs
in 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:
createInstanceConfig
in 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:
updateInstanceConfig
in interfaceSpannerRpc
- Throws:
SpannerException
-
getInstanceConfig
- Specified by:
getInstanceConfig
in interfaceSpannerRpc
- Throws:
SpannerException
-
deleteInstanceConfig
public void deleteInstanceConfig(String instanceConfigName, @Nullable String etag, @Nullable Boolean validateOnly) throws SpannerException - Specified by:
deleteInstanceConfig
in interfaceSpannerRpc
- Throws:
SpannerException
-
listInstanceConfigOperations
public SpannerRpc.Paginated<com.google.longrunning.Operation> listInstanceConfigOperations(int pageSize, @Nullable String filter, @Nullable String pageToken) Description copied from interface:SpannerRpc
List all long-running instance config operations on the given project.- Specified by:
listInstanceConfigOperations
in interfaceSpannerRpc
-
listInstances
public SpannerRpc.Paginated<Instance> listInstances(int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException - Specified by:
listInstances
in interfaceSpannerRpc
- Throws:
SpannerException
-
createInstance
public com.google.api.gax.longrunning.OperationFuture<Instance,CreateInstanceMetadata> createInstance(String parent, String instanceId, Instance instance) throws SpannerException - Specified by:
createInstance
in 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:
updateInstance
in interfaceSpannerRpc
- Throws:
SpannerException
-
getInstance
- Specified by:
getInstance
in interfaceSpannerRpc
- Throws:
SpannerException
-
deleteInstance
- Specified by:
deleteInstance
in 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:SpannerRpc
List all long-running backup operations on the given instance.- Specified by:
listBackupOperations
in interfaceSpannerRpc
-
listDatabaseOperations
public SpannerRpc.Paginated<com.google.longrunning.Operation> listDatabaseOperations(String instanceName, int pageSize, @Nullable String filter, @Nullable String pageToken) - Specified by:
listDatabaseOperations
in interfaceSpannerRpc
-
listDatabaseRoles
public SpannerRpc.Paginated<DatabaseRole> listDatabaseRoles(String databaseName, int pageSize, @Nullable String pageToken) - Specified by:
listDatabaseRoles
in interfaceSpannerRpc
-
listBackups
public SpannerRpc.Paginated<Backup> listBackups(String instanceName, int pageSize, @Nullable String filter, @Nullable String pageToken) throws SpannerException Description copied from interface:SpannerRpc
Lists the backups in the specified instance.- Specified by:
listBackups
in interfaceSpannerRpc
- Throws:
SpannerException
-
listDatabases
public SpannerRpc.Paginated<Database> listDatabases(String instanceName, int pageSize, @Nullable String pageToken) throws SpannerException - Specified by:
listDatabases
in 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:
createDatabase
in interfaceSpannerRpc
- Throws:
SpannerException
-
updateDatabaseDdl
public com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdl(String databaseName, 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:
updateDatabaseDdl
in interfaceSpannerRpc
- Throws:
SpannerException
-
dropDatabase
- Specified by:
dropDatabase
in interfaceSpannerRpc
- Throws:
SpannerException
-
getDatabase
- Specified by:
getDatabase
in 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:SpannerRpc
Updates the specified fields of a Cloud Spanner database.- Specified by:
updateDatabase
in 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:
getDatabaseDdl
in interfaceSpannerRpc
- Throws:
SpannerException
-
createBackup
public com.google.api.gax.longrunning.OperationFuture<Backup,CreateBackupMetadata> createBackup(Backup backupInfo) throws SpannerException Description copied from interface:SpannerRpc
Creates a new backup from the source database specified in theBackup
instance.- Specified by:
createBackup
in 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:SpannerRpc
Creates a copy backup from the source backup specified.- Specified by:
copyBackup
in interfaceSpannerRpc
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.- 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:SpannerRpc
Restore a backup into the given database.- Specified by:
restoreDatabase
in interfaceSpannerRpc
- Parameters:
restore
- aRestore
instance with the backup source and destination database
-
updateBackup
Description copied from interface:SpannerRpc
Updates the specified backup. The only supported field for updates is expireTime.- Specified by:
updateBackup
in interfaceSpannerRpc
-
deleteBackup
Description copied from interface:SpannerRpc
Deletes a pending or completed backup.- Specified by:
deleteBackup
in interfaceSpannerRpc
- Parameters:
backupName
- Required. The fully qualified name of the backup to delete.
-
getBackup
Description copied from interface:SpannerRpc
Gets the backup with the specified name.- Specified by:
getBackup
in interfaceSpannerRpc
- Throws:
SpannerException
-
getOperation
Description copied from interface:SpannerRpc
Retrieves a long running operation.- Specified by:
getOperation
in interfaceSpannerRpc
- Throws:
SpannerException
-
cancelOperation
Description copied from interface:SpannerRpc
Cancels the specified long-running operation.- Specified by:
cancelOperation
in 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:
batchCreateSessions
in 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:
createSession
in interfaceSpannerRpc
- Throws:
SpannerException
-
deleteSession
public void deleteSession(String sessionName, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
deleteSession
in interfaceSpannerRpc
- Throws:
SpannerException
-
asyncDeleteSession
public com.google.api.core.ApiFuture<com.google.protobuf.Empty> asyncDeleteSession(String sessionName, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
asyncDeleteSession
in interfaceSpannerRpc
-
getReadRetrySettings
public com.google.api.gax.retrying.RetrySettings getReadRetrySettings()Description copied from interface:SpannerRpc
Returns the retry settings for streaming read operations.- Specified by:
getReadRetrySettings
in interfaceSpannerRpc
-
getReadRetryableCodes
Description copied from interface:SpannerRpc
Returns the retryable codes for streaming read operations.- Specified by:
getReadRetryableCodes
in interfaceSpannerRpc
-
read
public SpannerRpc.StreamingCall read(ReadRequest request, SpannerRpc.ResultStreamConsumer consumer, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpc
Performs a streaming read.- Specified by:
read
in interfaceSpannerRpc
routeToLeader
- 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:SpannerRpc
Returns the retry settings for streaming query operations.- Specified by:
getExecuteQueryRetrySettings
in interfaceSpannerRpc
-
getExecuteQueryRetryableCodes
Description copied from interface:SpannerRpc
Returns the retryable codes for streaming query operations.- Specified by:
getExecuteQueryRetryableCodes
in interfaceSpannerRpc
-
executeQuery
public ResultSet executeQuery(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpc
Executes a query.- Specified by:
executeQuery
in interfaceSpannerRpc
routeToLeader
- 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:SpannerRpc
Executes a query asynchronously.- Specified by:
executeQueryAsync
in interfaceSpannerRpc
routeToLeader
- 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:
executePartitionedDml
in interfaceSpannerRpc
-
getPartitionedDmlRetrySettings
public com.google.api.gax.retrying.RetrySettings getPartitionedDmlRetrySettings()- Specified by:
getPartitionedDmlRetrySettings
in interfaceSpannerRpc
-
executeStreamingPartitionedDml
public com.google.api.gax.rpc.ServerStream<PartialResultSet> executeStreamingPartitionedDml(ExecuteSqlRequest request, Map<SpannerRpc.Option, ?> options, org.threeten.bp.Duration timeout) - Specified by:
executeStreamingPartitionedDml
in interfaceSpannerRpc
-
batchWriteAtLeastOnce
public com.google.api.gax.rpc.ServerStream<BatchWriteResponse> batchWriteAtLeastOnce(BatchWriteRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
batchWriteAtLeastOnce
in interfaceSpannerRpc
-
executeQuery
public SpannerRpc.StreamingCall executeQuery(ExecuteSqlRequest request, SpannerRpc.ResultStreamConsumer consumer, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpc
Executes a query with streaming result.- Specified by:
executeQuery
in interfaceSpannerRpc
routeToLeader
- 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:
executeBatchDml
in interfaceSpannerRpc
-
executeBatchDmlAsync
public com.google.api.core.ApiFuture<ExecuteBatchDmlResponse> executeBatchDmlAsync(ExecuteBatchDmlRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
executeBatchDmlAsync
in interfaceSpannerRpc
-
beginTransactionAsync
public com.google.api.core.ApiFuture<Transaction> beginTransactionAsync(BeginTransactionRequest request, @Nullable Map<SpannerRpc.Option, ?> options, boolean routeToLeader) Description copied from interface:SpannerRpc
Begins a transaction asynchronously.- Specified by:
beginTransactionAsync
in interfaceSpannerRpc
routeToLeader
- 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:SpannerRpc
Begins a transaction.- Specified by:
beginTransaction
in interfaceSpannerRpc
routeToLeader
- 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:
commitAsync
in interfaceSpannerRpc
-
commit
public CommitResponse commit(CommitRequest commitRequest, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
commit
in interfaceSpannerRpc
- Throws:
SpannerException
-
rollbackAsync
public com.google.api.core.ApiFuture<com.google.protobuf.Empty> rollbackAsync(RollbackRequest request, @Nullable Map<SpannerRpc.Option, ?> options) - Specified by:
rollbackAsync
in interfaceSpannerRpc
-
rollback
public void rollback(RollbackRequest request, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
rollback
in interfaceSpannerRpc
- Throws:
SpannerException
-
partitionQuery
public PartitionResponse partitionQuery(PartitionQueryRequest request, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
partitionQuery
in interfaceSpannerRpc
- Throws:
SpannerException
-
partitionRead
public PartitionResponse partitionRead(PartitionReadRequest request, @Nullable Map<SpannerRpc.Option, ?> options) throws SpannerException- Specified by:
partitionRead
in interfaceSpannerRpc
- Throws:
SpannerException
-
getDatabaseAdminIAMPolicy
public com.google.iam.v1.Policy getDatabaseAdminIAMPolicy(String resource, @Nullable com.google.iam.v1.GetPolicyOptions options) Description copied from interface:SpannerRpc
Gets the IAM policy for the given resource using theDatabaseAdminStub
.- Specified by:
getDatabaseAdminIAMPolicy
in interfaceSpannerRpc
-
setDatabaseAdminIAMPolicy
public com.google.iam.v1.Policy setDatabaseAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy) Description copied from interface:SpannerRpc
Updates 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:
setDatabaseAdminIAMPolicy
in interfaceSpannerRpc
-
testDatabaseAdminIAMPermissions
public com.google.iam.v1.TestIamPermissionsResponse testDatabaseAdminIAMPermissions(String resource, Iterable<String> permissions) Description copied from interface:SpannerRpc
Tests the IAM permissions for the given resource using theDatabaseAdminStub
.- Specified by:
testDatabaseAdminIAMPermissions
in interfaceSpannerRpc
-
getInstanceAdminIAMPolicy
Description copied from interface:SpannerRpc
Gets the IAM policy for the given resource using theInstanceAdminStub
.- Specified by:
getInstanceAdminIAMPolicy
in interfaceSpannerRpc
-
setInstanceAdminIAMPolicy
public com.google.iam.v1.Policy setInstanceAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy) Description copied from interface:SpannerRpc
Updates 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:
setInstanceAdminIAMPolicy
in interfaceSpannerRpc
-
testInstanceAdminIAMPermissions
public com.google.iam.v1.TestIamPermissionsResponse testInstanceAdminIAMPermissions(String resource, Iterable<String> permissions) Description copied from interface:SpannerRpc
Tests the IAM permissions for the given resource using theInstanceAdminStub
.- Specified by:
testInstanceAdminIAMPermissions
in interfaceSpannerRpc
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceSpannerRpc
-
shutdownNow
public void shutdownNow() -
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceSpannerRpc
-