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 for illustrative purposes only.
// It may require modifications to work in your environment.
SpannerSettings.Builder spannerSettingsBuilder = SpannerSettings.newBuilder();
spannerSettingsBuilder
.createSessionSettings()
.setRetrySettings(
spannerSettingsBuilder
.createSessionSettings()
.getRetrySettings()
.toBuilder()
.setTotalTimeout(Duration.ofSeconds(30))
.build());
SpannerSettings spannerSettings = spannerSettingsBuilder.build();
Static Methods
create(SpannerStubSettings stub)
public static final SpannerSettings create(SpannerStubSettings stub)
Name | Description |
stub | SpannerStubSettings |
Type | Description |
SpannerSettings |
Type | Description |
IOException |
defaultApiClientHeaderProviderBuilder()
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()
Type | Description |
Builder |
defaultCredentialsProviderBuilder()
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()
Returns a builder for the default credentials for this service.
Type | Description |
Builder |
defaultExecutorProviderBuilder()
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()
Returns a builder for the default ExecutorProvider for this service.
Type | Description |
Builder |
defaultGrpcTransportProviderBuilder()
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder()
Returns a builder for the default ChannelProvider for this service.
Type | Description |
Builder |
defaultTransportChannelProvider()
public static TransportChannelProvider defaultTransportChannelProvider()
Type | Description |
TransportChannelProvider |
getDefaultEndpoint()
public static String getDefaultEndpoint()
Returns the default service endpoint.
Type | Description |
String |
getDefaultServiceScopes()
public static List<String> getDefaultServiceScopes()
Returns the default service scopes.
Type | Description |
List<String> |
newBuilder()
public static SpannerSettings.Builder newBuilder()
Returns a new builder for this class.
Type | Description |
SpannerSettings.Builder |
newBuilder(ClientContext clientContext)
public static SpannerSettings.Builder newBuilder(ClientContext clientContext)
Returns a new builder for this class.
Name | Description |
clientContext | ClientContext |
Type | Description |
SpannerSettings.Builder |
Constructors
SpannerSettings(SpannerSettings.Builder settingsBuilder)
protected SpannerSettings(SpannerSettings.Builder settingsBuilder)
Name | Description |
settingsBuilder | SpannerSettings.Builder |
Methods
batchCreateSessionsSettings()
public UnaryCallSettings<BatchCreateSessionsRequest,BatchCreateSessionsResponse> batchCreateSessionsSettings()
Returns the object with the settings used for calls to batchCreateSessions.
Type | Description |
UnaryCallSettings<BatchCreateSessionsRequest,BatchCreateSessionsResponse> |
beginTransactionSettings()
public UnaryCallSettings<BeginTransactionRequest,Transaction> beginTransactionSettings()
Returns the object with the settings used for calls to beginTransaction.
Type | Description |
UnaryCallSettings<BeginTransactionRequest,Transaction> |
commitSettings()
public UnaryCallSettings<CommitRequest,CommitResponse> commitSettings()
Returns the object with the settings used for calls to commit.
Type | Description |
UnaryCallSettings<CommitRequest,CommitResponse> |
createSessionSettings()
public UnaryCallSettings<CreateSessionRequest,Session> createSessionSettings()
Returns the object with the settings used for calls to createSession.
Type | Description |
UnaryCallSettings<CreateSessionRequest,Session> |
deleteSessionSettings()
public UnaryCallSettings<DeleteSessionRequest,Empty> deleteSessionSettings()
Returns the object with the settings used for calls to deleteSession.
Type | Description |
UnaryCallSettings<DeleteSessionRequest,Empty> |
executeBatchDmlSettings()
public UnaryCallSettings<ExecuteBatchDmlRequest,ExecuteBatchDmlResponse> executeBatchDmlSettings()
Returns the object with the settings used for calls to executeBatchDml.
Type | Description |
UnaryCallSettings<ExecuteBatchDmlRequest,ExecuteBatchDmlResponse> |
executeSqlSettings()
public UnaryCallSettings<ExecuteSqlRequest,ResultSet> executeSqlSettings()
Returns the object with the settings used for calls to executeSql.
Type | Description |
UnaryCallSettings<ExecuteSqlRequest,ResultSet> |
executeStreamingSqlSettings()
public ServerStreamingCallSettings<ExecuteSqlRequest,PartialResultSet> executeStreamingSqlSettings()
Returns the object with the settings used for calls to executeStreamingSql.
Type | Description |
ServerStreamingCallSettings<ExecuteSqlRequest,PartialResultSet> |
getSessionSettings()
public UnaryCallSettings<GetSessionRequest,Session> getSessionSettings()
Returns the object with the settings used for calls to getSession.
Type | Description |
UnaryCallSettings<GetSessionRequest,Session> |
listSessionsSettings()
public PagedCallSettings<ListSessionsRequest,ListSessionsResponse,SpannerClient.ListSessionsPagedResponse> listSessionsSettings()
Returns the object with the settings used for calls to listSessions.
Type | Description |
PagedCallSettings<ListSessionsRequest,ListSessionsResponse,ListSessionsPagedResponse> |
partitionQuerySettings()
public UnaryCallSettings<PartitionQueryRequest,PartitionResponse> partitionQuerySettings()
Returns the object with the settings used for calls to partitionQuery.
Type | Description |
UnaryCallSettings<PartitionQueryRequest,PartitionResponse> |
partitionReadSettings()
public UnaryCallSettings<PartitionReadRequest,PartitionResponse> partitionReadSettings()
Returns the object with the settings used for calls to partitionRead.
Type | Description |
UnaryCallSettings<PartitionReadRequest,PartitionResponse> |
readSettings()
public UnaryCallSettings<ReadRequest,ResultSet> readSettings()
Returns the object with the settings used for calls to read.
Type | Description |
UnaryCallSettings<ReadRequest,ResultSet> |
rollbackSettings()
public UnaryCallSettings<RollbackRequest,Empty> rollbackSettings()
Returns the object with the settings used for calls to rollback.
Type | Description |
UnaryCallSettings<RollbackRequest,Empty> |
streamingReadSettings()
public ServerStreamingCallSettings<ReadRequest,PartialResultSet> streamingReadSettings()
Returns the object with the settings used for calls to streamingRead.
Type | Description |
ServerStreamingCallSettings<ReadRequest,PartialResultSet> |
toBuilder()
public SpannerSettings.Builder toBuilder()
Returns a builder containing all the values of this settings class.
Type | Description |
SpannerSettings.Builder |