Class SpannerSettings (6.54.0)

public class SpannerSettings extends ClientSettings<SpannerSettings>

Settings class to configure an instance of SpannerClient.

The default instance has everything set to sensible defaults:

  • The default service address (spanner.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of createSession to 30 seconds:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 SpannerSettings.Builder spannerSettingsBuilder = SpannerSettings.newBuilder();
 spannerSettingsBuilder
     .createSessionSettings()
     .setRetrySettings(
         spannerSettingsBuilder
             .createSessionSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 SpannerSettings spannerSettings = spannerSettingsBuilder.build();
 

Inheritance

java.lang.Object > ClientSettings > SpannerSettings

Static Methods

create(SpannerStubSettings stub)

public static final SpannerSettings create(SpannerStubSettings stub)
Parameter
NameDescription
stubSpannerStubSettings
Returns
TypeDescription
SpannerSettings
Exceptions
TypeDescription
IOException

defaultApiClientHeaderProviderBuilder()

public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()
Returns
TypeDescription
Builder

defaultCredentialsProviderBuilder()

public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()

Returns a builder for the default credentials for this service.

Returns
TypeDescription
Builder

defaultExecutorProviderBuilder()

public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()

Returns a builder for the default ExecutorProvider for this service.

Returns
TypeDescription
Builder

defaultGrpcTransportProviderBuilder()

public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder()

Returns a builder for the default gRPC ChannelProvider for this service.

Returns
TypeDescription
Builder

defaultHttpJsonTransportProviderBuilder()

public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder()

Returns a builder for the default REST ChannelProvider for this service.

Returns
TypeDescription
Builder

defaultTransportChannelProvider()

public static TransportChannelProvider defaultTransportChannelProvider()
Returns
TypeDescription
TransportChannelProvider

getDefaultEndpoint()

public static String getDefaultEndpoint()

Returns the default service endpoint.

Returns
TypeDescription
String

getDefaultServiceScopes()

public static List<String> getDefaultServiceScopes()

Returns the default service scopes.

Returns
TypeDescription
List<String>

newBuilder()

public static SpannerSettings.Builder newBuilder()

Returns a new gRPC builder for this class.

Returns
TypeDescription
SpannerSettings.Builder

newBuilder(ClientContext clientContext)

public static SpannerSettings.Builder newBuilder(ClientContext clientContext)

Returns a new builder for this class.

Parameter
NameDescription
clientContextClientContext
Returns
TypeDescription
SpannerSettings.Builder

newHttpJsonBuilder()

public static SpannerSettings.Builder newHttpJsonBuilder()

Returns a new REST builder for this class.

Returns
TypeDescription
SpannerSettings.Builder

Constructors

SpannerSettings(SpannerSettings.Builder settingsBuilder)

protected SpannerSettings(SpannerSettings.Builder settingsBuilder)
Parameter
NameDescription
settingsBuilderSpannerSettings.Builder

Methods

batchCreateSessionsSettings()

public UnaryCallSettings<BatchCreateSessionsRequest,BatchCreateSessionsResponse> batchCreateSessionsSettings()

Returns the object with the settings used for calls to batchCreateSessions.

Returns
TypeDescription
UnaryCallSettings<BatchCreateSessionsRequest,BatchCreateSessionsResponse>

batchWriteSettings()

public ServerStreamingCallSettings<BatchWriteRequest,BatchWriteResponse> batchWriteSettings()

Returns the object with the settings used for calls to batchWrite.

Returns
TypeDescription
ServerStreamingCallSettings<BatchWriteRequest,BatchWriteResponse>

beginTransactionSettings()

public UnaryCallSettings<BeginTransactionRequest,Transaction> beginTransactionSettings()

Returns the object with the settings used for calls to beginTransaction.

Returns
TypeDescription
UnaryCallSettings<BeginTransactionRequest,Transaction>

commitSettings()

public UnaryCallSettings<CommitRequest,CommitResponse> commitSettings()

Returns the object with the settings used for calls to commit.

Returns
TypeDescription
UnaryCallSettings<CommitRequest,CommitResponse>

createSessionSettings()

public UnaryCallSettings<CreateSessionRequest,Session> createSessionSettings()

Returns the object with the settings used for calls to createSession.

Returns
TypeDescription
UnaryCallSettings<CreateSessionRequest,Session>

deleteSessionSettings()

public UnaryCallSettings<DeleteSessionRequest,Empty> deleteSessionSettings()

Returns the object with the settings used for calls to deleteSession.

Returns
TypeDescription
UnaryCallSettings<DeleteSessionRequest,Empty>

executeBatchDmlSettings()

public UnaryCallSettings<ExecuteBatchDmlRequest,ExecuteBatchDmlResponse> executeBatchDmlSettings()

Returns the object with the settings used for calls to executeBatchDml.

Returns
TypeDescription
UnaryCallSettings<ExecuteBatchDmlRequest,ExecuteBatchDmlResponse>

executeSqlSettings()

public UnaryCallSettings<ExecuteSqlRequest,ResultSet> executeSqlSettings()

Returns the object with the settings used for calls to executeSql.

Returns
TypeDescription
UnaryCallSettings<ExecuteSqlRequest,ResultSet>

executeStreamingSqlSettings()

public ServerStreamingCallSettings<ExecuteSqlRequest,PartialResultSet> executeStreamingSqlSettings()

Returns the object with the settings used for calls to executeStreamingSql.

Returns
TypeDescription
ServerStreamingCallSettings<ExecuteSqlRequest,PartialResultSet>

getSessionSettings()

public UnaryCallSettings<GetSessionRequest,Session> getSessionSettings()

Returns the object with the settings used for calls to getSession.

Returns
TypeDescription
UnaryCallSettings<GetSessionRequest,Session>

listSessionsSettings()

public PagedCallSettings<ListSessionsRequest,ListSessionsResponse,SpannerClient.ListSessionsPagedResponse> listSessionsSettings()

Returns the object with the settings used for calls to listSessions.

Returns
TypeDescription
PagedCallSettings<ListSessionsRequest,ListSessionsResponse,ListSessionsPagedResponse>

partitionQuerySettings()

public UnaryCallSettings<PartitionQueryRequest,PartitionResponse> partitionQuerySettings()

Returns the object with the settings used for calls to partitionQuery.

Returns
TypeDescription
UnaryCallSettings<PartitionQueryRequest,PartitionResponse>

partitionReadSettings()

public UnaryCallSettings<PartitionReadRequest,PartitionResponse> partitionReadSettings()

Returns the object with the settings used for calls to partitionRead.

Returns
TypeDescription
UnaryCallSettings<PartitionReadRequest,PartitionResponse>

readSettings()

public UnaryCallSettings<ReadRequest,ResultSet> readSettings()

Returns the object with the settings used for calls to read.

Returns
TypeDescription
UnaryCallSettings<ReadRequest,ResultSet>

rollbackSettings()

public UnaryCallSettings<RollbackRequest,Empty> rollbackSettings()

Returns the object with the settings used for calls to rollback.

Returns
TypeDescription
UnaryCallSettings<RollbackRequest,Empty>

streamingReadSettings()

public ServerStreamingCallSettings<ReadRequest,PartialResultSet> streamingReadSettings()

Returns the object with the settings used for calls to streamingRead.

Returns
TypeDescription
ServerStreamingCallSettings<ReadRequest,PartialResultSet>

toBuilder()

public SpannerSettings.Builder toBuilder()

Returns a builder containing all the values of this settings class.

Returns
TypeDescription
SpannerSettings.Builder
Overrides