Class SpannerSettings

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:


 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 ChannelProvider for this service.

Returns
TypeDescription
Builder

defaultTransportChannelProvider()

public static TransportChannelProvider defaultTransportChannelProvider()
Returns

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 builder for this class.

Returns

newBuilder(ClientContext clientContext)

public static SpannerSettings.Builder newBuilder(ClientContext clientContext)

Returns a new builder for this class.

Parameter
NameDescription
clientContextClientContext
Returns

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

beginTransactionSettings()

public UnaryCallSettings<BeginTransactionRequest,Transaction> beginTransactionSettings()

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

Returns

commitSettings()

public UnaryCallSettings<CommitRequest,CommitResponse> commitSettings()

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

Returns

createSessionSettings()

public UnaryCallSettings<CreateSessionRequest,Session> createSessionSettings()

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

Returns

deleteSessionSettings()

public UnaryCallSettings<DeleteSessionRequest,Empty> deleteSessionSettings()

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

Returns

executeBatchDmlSettings()

public UnaryCallSettings<ExecuteBatchDmlRequest,ExecuteBatchDmlResponse> executeBatchDmlSettings()

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

Returns

executeSqlSettings()

public UnaryCallSettings<ExecuteSqlRequest,ResultSet> executeSqlSettings()

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

Returns

executeStreamingSqlSettings()

public ServerStreamingCallSettings<ExecuteSqlRequest,PartialResultSet> executeStreamingSqlSettings()

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

Returns

getSessionSettings()

public UnaryCallSettings<GetSessionRequest,Session> getSessionSettings()

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

Returns

listSessionsSettings()

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

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

Returns

partitionQuerySettings()

public UnaryCallSettings<PartitionQueryRequest,PartitionResponse> partitionQuerySettings()

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

Returns

partitionReadSettings()

public UnaryCallSettings<PartitionReadRequest,PartitionResponse> partitionReadSettings()

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

Returns

readSettings()

public UnaryCallSettings<ReadRequest,ResultSet> readSettings()

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

Returns

rollbackSettings()

public UnaryCallSettings<RollbackRequest,Empty> rollbackSettings()

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

Returns

streamingReadSettings()

public ServerStreamingCallSettings<ReadRequest,PartialResultSet> streamingReadSettings()

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

Returns

toBuilder()

public SpannerSettings.Builder toBuilder()

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

Returns Overrides