public class GapicSpannerRpc extends Object implements SpannerRpc
SpannerRpc.Option, SpannerRpc.Paginated<T>, SpannerRpc.ResultStreamConsumer, SpannerRpc.StreamingCall
Constructor and Description |
---|
GapicSpannerRpc(SpannerOptions options) |
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) |
static GapicSpannerRpc |
create(SpannerOptions 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 request,
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) |
public GapicSpannerRpc(SpannerOptions options)
public static GapicSpannerRpc create(SpannerOptions options)
public SpannerRpc.Paginated<InstanceConfig> listInstanceConfigs(int pageSize, @Nullable String pageToken) throws SpannerException
listInstanceConfigs
in interface SpannerRpc
SpannerException
public InstanceConfig getInstanceConfig(String instanceConfigName) throws SpannerException
getInstanceConfig
in interface SpannerRpc
SpannerException
public SpannerRpc.Paginated<Instance> listInstances(int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException
listInstances
in interface SpannerRpc
SpannerException
public com.google.api.gax.longrunning.OperationFuture<Instance,CreateInstanceMetadata> createInstance(String parent, String instanceId, Instance instance) throws SpannerException
createInstance
in interface SpannerRpc
SpannerException
public com.google.api.gax.longrunning.OperationFuture<Instance,UpdateInstanceMetadata> updateInstance(Instance instance, FieldMask fieldMask) throws SpannerException
updateInstance
in interface SpannerRpc
SpannerException
public Instance getInstance(String instanceName) throws SpannerException
getInstance
in interface SpannerRpc
SpannerException
public void deleteInstance(String instanceName) throws SpannerException
deleteInstance
in interface SpannerRpc
SpannerException
public SpannerRpc.Paginated<Database> listDatabases(String instanceName, int pageSize, @Nullable String pageToken) throws SpannerException
listDatabases
in interface SpannerRpc
SpannerException
public com.google.api.gax.longrunning.OperationFuture<Database,CreateDatabaseMetadata> createDatabase(String instanceName, String createDatabaseStatement, Iterable<String> additionalStatements) throws SpannerException
createDatabase
in interface SpannerRpc
SpannerException
public com.google.api.gax.longrunning.OperationFuture<Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdl(String databaseName, Iterable<String> updateDatabaseStatements, @Nullable String updateId) throws SpannerException
updateDatabaseDdl
in interface SpannerRpc
SpannerException
public void dropDatabase(String databaseName) throws SpannerException
dropDatabase
in interface SpannerRpc
SpannerException
public Database getDatabase(String databaseName) throws SpannerException
getDatabase
in interface SpannerRpc
SpannerException
public List<String> getDatabaseDdl(String databaseName) throws SpannerException
getDatabaseDdl
in interface SpannerRpc
SpannerException
public com.google.longrunning.Operation getOperation(String name) throws SpannerException
SpannerRpc
getOperation
in interface SpannerRpc
SpannerException
public List<Session> batchCreateSessions(String databaseName, int sessionCount, @Nullable Map<String,String> labels, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
batchCreateSessions
in interface SpannerRpc
SpannerException
public Session createSession(String databaseName, @Nullable Map<String,String> labels, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
createSession
in interface SpannerRpc
SpannerException
public void deleteSession(String sessionName, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
deleteSession
in interface SpannerRpc
SpannerException
public SpannerRpc.StreamingCall read(ReadRequest request, SpannerRpc.ResultStreamConsumer consumer, @Nullable Map<SpannerRpc.Option,?> options)
read
in interface SpannerRpc
public ResultSet executeQuery(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option,?> options)
executeQuery
in interface SpannerRpc
public ResultSet executePartitionedDml(ExecuteSqlRequest request, @Nullable Map<SpannerRpc.Option,?> options, org.threeten.bp.Duration timeout)
executePartitionedDml
in interface SpannerRpc
public SpannerRpc.StreamingCall executeQuery(ExecuteSqlRequest request, SpannerRpc.ResultStreamConsumer consumer, @Nullable Map<SpannerRpc.Option,?> options)
executeQuery
in interface SpannerRpc
public ExecuteBatchDmlResponse executeBatchDml(ExecuteBatchDmlRequest request, @Nullable Map<SpannerRpc.Option,?> options)
executeBatchDml
in interface SpannerRpc
public Transaction beginTransaction(BeginTransactionRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
beginTransaction
in interface SpannerRpc
SpannerException
public CommitResponse commit(CommitRequest commitRequest, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
commit
in interface SpannerRpc
SpannerException
public void rollback(RollbackRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
rollback
in interface SpannerRpc
SpannerException
public PartitionResponse partitionQuery(PartitionQueryRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
partitionQuery
in interface SpannerRpc
SpannerException
public PartitionResponse partitionRead(PartitionReadRequest request, @Nullable Map<SpannerRpc.Option,?> options) throws SpannerException
partitionRead
in interface SpannerRpc
SpannerException
public com.google.iam.v1.Policy getDatabaseAdminIAMPolicy(String resource)
SpannerRpc
DatabaseAdminStub
.getDatabaseAdminIAMPolicy
in interface SpannerRpc
public com.google.iam.v1.Policy setDatabaseAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy)
SpannerRpc
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.setDatabaseAdminIAMPolicy
in interface SpannerRpc
public com.google.iam.v1.TestIamPermissionsResponse testDatabaseAdminIAMPermissions(String resource, Iterable<String> permissions)
SpannerRpc
DatabaseAdminStub
.testDatabaseAdminIAMPermissions
in interface SpannerRpc
public com.google.iam.v1.Policy getInstanceAdminIAMPolicy(String resource)
SpannerRpc
InstanceAdminStub
.getInstanceAdminIAMPolicy
in interface SpannerRpc
public com.google.iam.v1.Policy setInstanceAdminIAMPolicy(String resource, com.google.iam.v1.Policy policy)
SpannerRpc
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.setInstanceAdminIAMPolicy
in interface SpannerRpc
public com.google.iam.v1.TestIamPermissionsResponse testInstanceAdminIAMPermissions(String resource, Iterable<String> permissions)
SpannerRpc
InstanceAdminStub
.testInstanceAdminIAMPermissions
in interface SpannerRpc
public void shutdown()
shutdown
in interface SpannerRpc
public boolean isClosed()
isClosed
in interface SpannerRpc
Copyright © 2019 Google LLC. All rights reserved.