public class SpannerOptions extends com.google.cloud.ServiceOptions<Spanner,SpannerOptions>
Modifier and Type | Class and Description |
---|---|
static class |
SpannerOptions.Builder
Builder for
SpannerOptions instances. |
static interface |
SpannerOptions.CallContextConfigurator
SpannerOptions.CallContextConfigurator can be used to modify the ApiCallContext for one or
more specific RPCs. |
static interface |
SpannerOptions.CallCredentialsProvider
|
static interface |
SpannerOptions.CloseableExecutorProvider
ExecutorProvider that is used for AsyncResultSet . |
static class |
SpannerOptions.FixedCloseableExecutorProvider
Implementation of
SpannerOptions.CloseableExecutorProvider that uses a fixed single ScheduledExecutorService . |
static class |
SpannerOptions.SpannerCallContextTimeoutConfigurator
Helper class to configure timeouts for specific Spanner RPCs.
|
static interface |
SpannerOptions.SpannerEnvironment
The environment to read configuration values from.
|
Modifier and Type | Field and Description |
---|---|
static io.grpc.Context.Key<SpannerOptions.CallContextConfigurator> |
CALL_CONTEXT_CONFIGURATOR_KEY
Context key for the
SpannerOptions.CallContextConfigurator to use. |
baseEquals, baseHashCode, defaultRetrySettings, getAppEngineAppId, getAppEngineProjectId, getAppEngineProjectIdFromAppId, getApplicationName, getClientLibToken, getClock, getCredentials, getDefaultProject, getDefaultProjectId, getDefaultRetrySettings, getFromServiceLoader, getGoogApiClientLibName, getGoogleCloudProjectId, getHost, getLibraryName, getLibraryVersion, getMergedHeaderProvider, getNoRetrySettings, getProjectId, getQuotaProjectId, getRetrySettings, getRpc, getScopedCredentials, getService, getServiceAccountProjectId, getTransportOptions, getUserAgent, newInstance, projectIdRequired
public static final io.grpc.Context.Key<SpannerOptions.CallContextConfigurator> CALL_CONTEXT_CONFIGURATOR_KEY
SpannerOptions.CallContextConfigurator
to use.public static SpannerOptions.CloseableExecutorProvider createAsyncExecutorProvider(int poolSize, long keepAliveTime, TimeUnit unit)
SpannerOptions.CloseableExecutorProvider
that can be used as an ExecutorProvider
for
the async API. The ExecutorProvider
will lazily create up to poolSize threads. The
backing threads will automatically be shutdown if they have not been used during the keep-alive
time. The backing threads are created as daemon threads.poolSize
- the maximum number of threads to create in the poolkeepAliveTime
- the time that an unused thread in the pool should be kept aliveunit
- the time unit used for the keepAliveTimeSpannerOptions.CloseableExecutorProvider
that can be used for SpannerOptions.Builder#setAsyncExecutorProvider(CloseableExecutorProvider)
public static SpannerOptions getDefaultInstance()
SpannerOptions
.public static SpannerOptions.Builder newBuilder()
public static void useEnvironment(SpannerOptions.SpannerEnvironment environment)
public static void useDefaultEnvironment()
public com.google.api.gax.rpc.TransportChannelProvider getChannelProvider()
public com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> getChannelConfigurator()
public com.google.api.gax.grpc.GrpcInterceptorProvider getInterceptorProvider()
public int getNumChannels()
public String getTransportChannelExecutorThreadNameFormat()
public SessionPoolOptions getSessionPoolOptions()
public SpannerStubSettings getSpannerStubSettings()
public InstanceAdminStubSettings getInstanceAdminStubSettings()
public DatabaseAdminStubSettings getDatabaseAdminStubSettings()
public org.threeten.bp.Duration getPartitionedDmlTimeout()
public boolean isGrpcGcpExtensionEnabled()
public com.google.cloud.grpc.GcpManagedChannelOptions getGrpcGcpOptions()
public boolean isAutoThrottleAdministrativeRequests()
public com.google.api.gax.retrying.RetrySettings getRetryAdministrativeRequestsSettings()
public boolean isTrackTransactionStarter()
public SpannerOptions.CallCredentialsProvider getCallCredentialsProvider()
public String getCompressorName()
public ExecuteSqlRequest.QueryOptions getDefaultQueryOptions(DatabaseId databaseId)
public SpannerOptions.CloseableExecutorProvider getAsyncExecutorProvider()
public int getPrefetchChunks()
public static com.google.cloud.grpc.GrpcTransportOptions getDefaultGrpcTransportOptions()
protected String getDefaultHost()
getDefaultHost
in class com.google.cloud.ServiceOptions<Spanner,SpannerOptions>
public Set<String> getScopes()
getScopes
in class com.google.cloud.ServiceOptions<Spanner,SpannerOptions>
protected SpannerRpc getSpannerRpcV1()
protected boolean shouldRefreshService(Spanner cachedService)
shouldRefreshService
in class com.google.cloud.ServiceOptions<Spanner,SpannerOptions>
true
if the cached Spanner service instance is null
or
closed. This will cause the method ServiceOptions.getService()
to create a new SpannerRpc
instance when one is requested.protected boolean shouldRefreshRpc(com.google.cloud.ServiceRpc cachedRpc)
shouldRefreshRpc
in class com.google.cloud.ServiceOptions<Spanner,SpannerOptions>
true
if the cached ServiceRpc
instance is null
or
closed. This will cause the method ServiceOptions.getRpc()
to create a new Spanner
instance when one is requested.public SpannerOptions.Builder toBuilder()
toBuilder
in class com.google.cloud.ServiceOptions<Spanner,SpannerOptions>
public String getEndpoint()
Copyright © 2021 Google LLC. All rights reserved.