Package | Description |
---|---|
com.google.cloud.spanner |
A client for Cloud Spanner - A no-compromise relational database service.
|
com.google.cloud.spanner.connection |
Internal API for Google Cloud Spanner.
|
com.google.cloud.spanner.spi.v1 | |
com.google.cloud.spanner.testing |
Modifier and Type | Class and Description |
---|---|
class |
AbortedDueToConcurrentModificationException
Exception thrown by a
Connection when a database operation detects that a transaction has
aborted and an internal retry failed because of a concurrent modification. |
class |
AbortedException
Exception thrown by Cloud Spanner when an operation detects that a transaction has aborted.
|
class |
AdminRequestsPerMinuteExceededException
Exception thrown by Cloud Spanner the number of administrative requests per minute has been
exceeded.
|
class |
DatabaseNotFoundException
Exception thrown by Cloud Spanner when an operation detects that the database that is being used
no longer exists.
|
class |
InstanceNotFoundException
Exception thrown by Cloud Spanner when an operation detects that the instance that is being used
no longer exists.
|
class |
SessionNotFoundException
Exception thrown by Cloud Spanner when an operation detects that the session that is being used
is no longer valid.
|
class |
SpannerBatchUpdateException |
static class |
SpannerException.ResourceNotFoundException
Base exception type for NOT_FOUND exceptions for known resource types.
|
Modifier and Type | Method and Description |
---|---|
static SpannerException |
SpannerExceptionFactory.asSpannerException(Throwable t)
Converts the given
Throwable to a SpannerException . |
SpannerException |
AbortedDueToConcurrentModificationException.getDatabaseErrorDuringRetry() |
static SpannerException |
SpannerExceptionFactory.newSpannerException(Context context,
Throwable cause)
Creates a new exception based on
cause . |
static SpannerException |
SpannerExceptionFactory.newSpannerException(ErrorCode code,
String message) |
static SpannerException |
SpannerExceptionFactory.newSpannerException(ErrorCode code,
String message,
Throwable cause) |
static SpannerException |
SpannerExceptionFactory.newSpannerException(Throwable cause)
Creates a new exception based on
cause . |
static SpannerException |
SpannerExceptionFactory.propagateInterrupt(InterruptedException e) |
static SpannerException |
SpannerExceptionFactory.propagateTimeout(TimeoutException e)
Transforms a
TimeoutException to a SpannerException . |
Modifier and Type | Method and Description |
---|---|
static AbortedDueToConcurrentModificationException |
SpannerExceptionFactory.newAbortedDueToConcurrentModificationException(AbortedException cause,
SpannerException databaseError)
Constructs a specific aborted exception that should only be thrown by a connection after an
internal retry aborted because a database call caused an exception that did not happen during
the original attempt.
|
Modifier and Type | Method and Description |
---|---|
OperationFuture<Backup,CreateBackupMetadata> |
DatabaseAdminClient.createBackup(Backup backup)
Creates a new backup from a database in a Cloud Spanner.
|
OperationFuture<Backup,CreateBackupMetadata> |
DatabaseAdminClient.createBackup(String sourceInstanceId,
String backupId,
String databaseId,
com.google.cloud.Timestamp expireTime)
Creates a new backup from a database in a Cloud Spanner instance.
|
OperationFuture<Database,CreateDatabaseMetadata> |
DatabaseAdminClient.createDatabase(Database database,
Iterable<String> statements)
Creates a database in a Cloud Spanner instance.
|
OperationFuture<Database,CreateDatabaseMetadata> |
Instance.createDatabase(String databaseId,
Iterable<String> statements)
Creates a new database in this instance.
|
default OperationFuture<Database,CreateDatabaseMetadata> |
DatabaseAdminClient.createDatabase(String instanceId,
String createDatabaseStatement,
Dialect dialect,
Iterable<String> statements)
Creates a new database in a Cloud Spanner instance with the given
Dialect . |
OperationFuture<Database,CreateDatabaseMetadata> |
DatabaseAdminClient.createDatabase(String instanceId,
String databaseId,
Iterable<String> statements)
Creates a new database in a Cloud Spanner instance.
|
OperationFuture<Instance,CreateInstanceMetadata> |
InstanceAdminClient.createInstance(InstanceInfo instance)
Creates an instance and begins preparing it to begin serving.
|
void |
Backup.delete()
Deletes this backup on Cloud Spanner.
|
void |
InstanceAdminClient.deleteInstance(String instanceId)
Deletes an instance.
|
void |
Database.drop()
Drops this database.
|
void |
DatabaseAdminClient.dropDatabase(String instanceId,
String databaseId)
Drops a Cloud Spanner database.
|
ResultSet |
BatchReadOnlyTransaction.execute(Partition partition)
Execute the partition to return
ResultSet . |
static <T> T |
SpannerApiFutures.get(com.google.api.core.ApiFuture<T> future) |
Backup |
DatabaseAdminClient.getBackup(String instanceId,
String backupId)
Gets the current state of a Cloud Spanner database backup.
|
Database |
DatabaseAdminClient.getDatabase(String instanceId,
String databaseId)
Gets the current state of a Cloud Spanner database.
|
Iterable<String> |
Database.getDdl()
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements.
|
Instance |
InstanceAdminClient.getInstance(String instanceId)
Gets an instance.
|
InstanceConfig |
InstanceAdminClient.getInstanceConfig(String configId)
Gets an instance config.
|
static <T> T |
SpannerApiFutures.getOrNull(com.google.api.core.ApiFuture<T> future) |
R |
Operation.getResult()
Returns result of the operation if the operation is complete and had a result.
|
Page<InstanceConfig> |
InstanceAdminClient.listInstanceConfigs(Options.ListOption... options)
Lists the supported instance configs for current project.
|
Page<Instance> |
InstanceAdminClient.listInstances(Options.ListOption... options)
Lists the instances.
|
boolean |
ForwardingResultSet.next() |
boolean |
ResultSet.next()
Advances the result set to the next row, returning false if no such row exists.
|
List<Partition> |
BatchReadOnlyTransaction.partitionQuery(PartitionOptions partitionOptions,
Statement statement,
Options.QueryOption... options)
Returns a list of
Partition to execute a query against the database. |
List<Partition> |
BatchReadOnlyTransaction.partitionRead(PartitionOptions partitionOptions,
String table,
KeySet keys,
Iterable<String> columns,
Options.ReadOption... options)
Returns a list of
Partition to read zero or more rows from a database. |
List<Partition> |
BatchReadOnlyTransaction.partitionReadUsingIndex(PartitionOptions partitionOptions,
String table,
String index,
KeySet keys,
Iterable<String> columns,
Options.ReadOption... options)
Returns a list of
Partition to read zero or more rows from a database using an index. |
Operation<R,M> |
Operation.reload()
Fetches the current status of this operation.
|
Database |
Database.reload()
Fetches the database's current information.
|
Backup |
Backup.reload()
Fetches the backup's current information and returns a new
Backup instance. |
OperationFuture<Database,RestoreDatabaseMetadata> |
DatabaseAdminClient.restoreDatabase(Restore restore)
Restore a database from a backup.
|
OperationFuture<Database,RestoreDatabaseMetadata> |
DatabaseAdminClient.restoreDatabase(String backupInstanceId,
String backupId,
String restoreInstanceId,
String restoreDatabaseId)
Restore a database from a backup.
|
<T> List<T> |
AsyncResultSet.toList(com.google.common.base.Function<StructReader,T> transformer)
Transforms the row cursor into an immutable list using the given transformer function.
|
<T> List<T> |
ForwardingAsyncResultSet.toList(com.google.common.base.Function<StructReader,T> transformer) |
AsyncResultSet.CursorState |
AsyncResultSet.tryNext()
Non-blocking call that attempts to step the cursor to the next position in the stream.
|
AsyncResultSet.CursorState |
ForwardingAsyncResultSet.tryNext() |
OperationFuture<Void,UpdateDatabaseDdlMetadata> |
DatabaseAdminClient.updateDatabaseDdl(String instanceId,
String databaseId,
Iterable<String> statements,
String operationId)
Enqueues the given DDL statements to be applied, in order but not necessarily all at once, to
the database schema at some point (or points) in the future.
|
OperationFuture<Void,UpdateDatabaseDdlMetadata> |
Database.updateDdl(Iterable<String> statements,
String operationId)
Enqueues the given DDL statements to be applied, in order but not necessarily all at once, to
the database schema at some point (or points) in the future.
|
Operation<R,M> |
Operation.waitFor(com.google.cloud.RetryOption... waitOptions)
Blocks till the operation is complete or maximum time, if specified, has elapsed.
|
com.google.cloud.Timestamp |
DatabaseClient.write(Iterable<Mutation> mutations)
Writes the given mutations atomically to the database.
|
com.google.cloud.Timestamp |
DatabaseClient.writeAtLeastOnce(Iterable<Mutation> mutations)
Writes the given mutations atomically to the database without replay protection.
|
CommitResponse |
DatabaseClient.writeAtLeastOnceWithOptions(Iterable<Mutation> mutations,
Options.TransactionOption... options)
Writes the given mutations atomically to the database without replay protection.
|
CommitResponse |
DatabaseClient.writeWithOptions(Iterable<Mutation> mutations,
Options.TransactionOption... options)
Writes the given mutations atomically to the database with the given options.
|
Modifier and Type | Method and Description |
---|---|
static com.google.cloud.Timestamp |
ReadOnlyStalenessUtil.parseRfc3339(String str)
Parses an RFC3339 date/time value with nanosecond precision and returns this as a
Timestamp . |
Modifier and Type | Method and Description |
---|---|
void |
SpannerRpc.ResultStreamConsumer.onError(SpannerException e) |
Modifier and Type | Method and Description |
---|---|
com.google.api.core.ApiFuture<Empty> |
SpannerRpc.asyncDeleteSession(String sessionName,
Map<SpannerRpc.Option,?> options) |
List<Session> |
GapicSpannerRpc.batchCreateSessions(String databaseName,
int sessionCount,
Map<String,String> labels,
Map<SpannerRpc.Option,?> options) |
List<Session> |
SpannerRpc.batchCreateSessions(String databaseName,
int sessionCount,
Map<String,String> labels,
Map<SpannerRpc.Option,?> options) |
Transaction |
GapicSpannerRpc.beginTransaction(BeginTransactionRequest request,
Map<SpannerRpc.Option,?> options) |
Transaction |
SpannerRpc.beginTransaction(BeginTransactionRequest request,
Map<SpannerRpc.Option,?> options) |
void |
GapicSpannerRpc.cancelOperation(String name) |
void |
SpannerRpc.cancelOperation(String name)
Cancels the specified long-running operation.
|
CommitResponse |
GapicSpannerRpc.commit(CommitRequest commitRequest,
Map<SpannerRpc.Option,?> options) |
CommitResponse |
SpannerRpc.commit(CommitRequest commitRequest,
Map<SpannerRpc.Option,?> options) |
OperationFuture<Backup,CopyBackupMetadata> |
GapicSpannerRpc.copyBackup(BackupId sourceBackupId,
Backup destinationBackup) |
OperationFuture<Backup,CreateBackupMetadata> |
GapicSpannerRpc.createBackup(Backup backupInfo) |
OperationFuture<Backup,CreateBackupMetadata> |
SpannerRpc.createBackup(Backup backupInfo)
Creates a new backup from the source database specified in the
Backup instance. |
OperationFuture<Database,CreateDatabaseMetadata> |
GapicSpannerRpc.createDatabase(String instanceName,
String createDatabaseStatement,
Iterable<String> additionalStatements,
Database databaseInfo) |
OperationFuture<Database,CreateDatabaseMetadata> |
SpannerRpc.createDatabase(String instanceName,
String createDatabaseStatement,
Iterable<String> additionalStatements,
Database database) |
OperationFuture<Instance,CreateInstanceMetadata> |
GapicSpannerRpc.createInstance(String parent,
String instanceId,
Instance instance) |
OperationFuture<Instance,CreateInstanceMetadata> |
SpannerRpc.createInstance(String parent,
String instanceId,
Instance instance) |
Session |
GapicSpannerRpc.createSession(String databaseName,
Map<String,String> labels,
Map<SpannerRpc.Option,?> options) |
Session |
SpannerRpc.createSession(String databaseName,
Map<String,String> labels,
Map<SpannerRpc.Option,?> options) |
void |
GapicSpannerRpc.deleteInstance(String instanceName) |
void |
SpannerRpc.deleteInstance(String instanceName) |
void |
GapicSpannerRpc.deleteSession(String sessionName,
Map<SpannerRpc.Option,?> options) |
void |
SpannerRpc.deleteSession(String sessionName,
Map<SpannerRpc.Option,?> options) |
void |
GapicSpannerRpc.dropDatabase(String databaseName) |
void |
SpannerRpc.dropDatabase(String databaseName) |
Backup |
GapicSpannerRpc.getBackup(String backupName) |
Backup |
SpannerRpc.getBackup(String backupName)
Gets the backup with the specified name.
|
Database |
GapicSpannerRpc.getDatabase(String databaseName) |
Database |
SpannerRpc.getDatabase(String databaseName) |
List<String> |
GapicSpannerRpc.getDatabaseDdl(String databaseName) |
List<String> |
SpannerRpc.getDatabaseDdl(String databaseName) |
Instance |
GapicSpannerRpc.getInstance(String instanceName) |
Instance |
SpannerRpc.getInstance(String instanceName) |
InstanceConfig |
GapicSpannerRpc.getInstanceConfig(String instanceConfigName) |
InstanceConfig |
SpannerRpc.getInstanceConfig(String instanceConfigName) |
Operation |
GapicSpannerRpc.getOperation(String name) |
Operation |
SpannerRpc.getOperation(String name)
Retrieves a long running operation.
|
SpannerRpc.Paginated<Backup> |
GapicSpannerRpc.listBackups(String instanceName,
int pageSize,
String filter,
String pageToken) |
SpannerRpc.Paginated<Backup> |
SpannerRpc.listBackups(String instanceName,
int pageSize,
String filter,
String pageToken)
Lists the backups in the specified instance.
|
SpannerRpc.Paginated<Database> |
GapicSpannerRpc.listDatabases(String instanceName,
int pageSize,
String pageToken) |
SpannerRpc.Paginated<Database> |
SpannerRpc.listDatabases(String instanceName,
int pageSize,
String pageToken) |
SpannerRpc.Paginated<InstanceConfig> |
GapicSpannerRpc.listInstanceConfigs(int pageSize,
String pageToken) |
SpannerRpc.Paginated<InstanceConfig> |
SpannerRpc.listInstanceConfigs(int pageSize,
String pageToken) |
SpannerRpc.Paginated<Instance> |
GapicSpannerRpc.listInstances(int pageSize,
String pageToken,
String filter) |
SpannerRpc.Paginated<Instance> |
SpannerRpc.listInstances(int pageSize,
String pageToken,
String filter) |
PartitionResponse |
GapicSpannerRpc.partitionQuery(PartitionQueryRequest request,
Map<SpannerRpc.Option,?> options) |
PartitionResponse |
SpannerRpc.partitionQuery(PartitionQueryRequest request,
Map<SpannerRpc.Option,?> options) |
PartitionResponse |
GapicSpannerRpc.partitionRead(PartitionReadRequest request,
Map<SpannerRpc.Option,?> options) |
PartitionResponse |
SpannerRpc.partitionRead(PartitionReadRequest request,
Map<SpannerRpc.Option,?> options) |
void |
GapicSpannerRpc.rollback(RollbackRequest request,
Map<SpannerRpc.Option,?> options) |
void |
SpannerRpc.rollback(RollbackRequest request,
Map<SpannerRpc.Option,?> options) |
OperationFuture<Empty,UpdateDatabaseDdlMetadata> |
GapicSpannerRpc.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.
|
OperationFuture<Empty,UpdateDatabaseDdlMetadata> |
SpannerRpc.updateDatabaseDdl(String databaseName,
Iterable<String> updateDatabaseStatements,
String updateId) |
OperationFuture<Instance,UpdateInstanceMetadata> |
GapicSpannerRpc.updateInstance(Instance instance,
FieldMask fieldMask) |
OperationFuture<Instance,UpdateInstanceMetadata> |
SpannerRpc.updateInstance(Instance instance,
FieldMask fieldMask) |
Modifier and Type | Method and Description |
---|---|
Database |
RemoteSpannerHelper.createTestDatabase(Dialect dialect,
Iterable<String> statements)
Creates a test database defined by
statements in the test instance. |
Database |
RemoteSpannerHelper.createTestDatabase(Iterable<String> statements) |
Database |
RemoteSpannerHelper.createTestDatabase(String... statements)
Creates a test database defined by
statements . |
Copyright © 2022 Google LLC. All rights reserved.