public class SpannerStubSettings extends StubSettings<SpannerStubSettings>
Settings class to configure an instance of SpannerStub.
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:
SpannerStubSettings.Builder spannerSettingsBuilder = SpannerStubSettings.newBuilder();
spannerSettingsBuilder
.createSessionSettings()
.setRetrySettings(
spannerSettingsBuilder
.createSessionSettings()
.getRetrySettings()
.toBuilder()
.setTotalTimeout(Duration.ofSeconds(30))
.build());
SpannerStubSettings spannerSettings = spannerSettingsBuilder.build();
Constructors
SpannerStubSettings(SpannerStubSettings.Builder settingsBuilder)
protected SpannerStubSettings(SpannerStubSettings.Builder settingsBuilder)
Name | Description |
settingsBuilder | SpannerStubSettings.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> |
createStub()
public SpannerStub createStub()
Type | Description |
SpannerStub |
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 |
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> |
getDefaultEndpoint()
public static String getDefaultEndpoint()
Returns the default service endpoint.
Type | Description |
String |
getDefaultMtlsEndpoint()
public static String getDefaultMtlsEndpoint()
Returns the default mTLS service endpoint.
Type | Description |
String |
getDefaultServiceScopes()
public static List<String> getDefaultServiceScopes()
Returns the default service scopes.
Type | Description |
List<String> |
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> |
newBuilder()
public static SpannerStubSettings.Builder newBuilder()
Returns a new builder for this class.
Type | Description |
SpannerStubSettings.Builder |
newBuilder(ClientContext clientContext)
public static SpannerStubSettings.Builder newBuilder(ClientContext clientContext)
Returns a new builder for this class.
Name | Description |
clientContext | ClientContext |
Type | Description |
SpannerStubSettings.Builder |
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 SpannerStubSettings.Builder toBuilder()
Returns a builder containing all the values of this settings class.
Type | Description |
SpannerStubSettings.Builder |