public class SpannerOptions extends ServiceOptions<Spanner,SpannerOptions>
Options for the Cloud Spanner service.
Static Fields
CALL_CONTEXT_CONFIGURATOR_KEY
public static final Context.Key<SpannerOptions.CallContextConfigurator> CALL_CONTEXT_CONFIGURATOR_KEY
Context key for the CallContextConfigurator to use.
Type | Description |
io.grpc.Context.Key<CallContextConfigurator> |
Static Methods
createAsyncExecutorProvider(int poolSize, long keepAliveTime, TimeUnit unit)
public static SpannerOptions.CloseableExecutorProvider createAsyncExecutorProvider(int poolSize, long keepAliveTime, TimeUnit unit)
Creates a 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.
Name | Description |
poolSize | int the maximum number of threads to create in the pool |
keepAliveTime | long the time that an unused thread in the pool should be kept alive |
unit | TimeUnit the time unit used for the keepAliveTime |
Type | Description |
SpannerOptions.CloseableExecutorProvider | a CloseableExecutorProvider that can be used for SpannerOptions.Builder#setAsyncExecutorProvider(CloseableExecutorProvider) |
getDefaultGrpcTransportOptions()
public static GrpcTransportOptions getDefaultGrpcTransportOptions()
Type | Description |
com.google.cloud.grpc.GrpcTransportOptions |
getDefaultInstance()
public static SpannerOptions getDefaultInstance()
Returns default instance of SpannerOptions
.
Type | Description |
SpannerOptions |
newBuilder()
public static SpannerOptions.Builder newBuilder()
Type | Description |
SpannerOptions.Builder |
useDefaultEnvironment()
public static void useDefaultEnvironment()
Sets the environment to use to read configuration to the default environment. This will read configuration from environment variables.
useEnvironment(SpannerOptions.SpannerEnvironment environment)
public static void useEnvironment(SpannerOptions.SpannerEnvironment environment)
Sets the environment to use to read configuration. The default will read configuration from environment variables.
Name | Description |
environment | SpannerOptions.SpannerEnvironment |
Methods
getAsyncExecutorProvider()
public SpannerOptions.CloseableExecutorProvider getAsyncExecutorProvider()
Type | Description |
SpannerOptions.CloseableExecutorProvider |
getCallCredentialsProvider()
public SpannerOptions.CallCredentialsProvider getCallCredentialsProvider()
Type | Description |
SpannerOptions.CallCredentialsProvider |
getChannelConfigurator()
public ApiFunction<ManagedChannelBuilder,ManagedChannelBuilder> getChannelConfigurator()
Type | Description |
ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> |
getChannelProvider()
public TransportChannelProvider getChannelProvider()
Type | Description |
TransportChannelProvider |
getCompressorName()
public String getCompressorName()
Type | Description |
String |
getDatabaseAdminStubSettings()
public DatabaseAdminStubSettings getDatabaseAdminStubSettings()
Type | Description |
DatabaseAdminStubSettings |
getDefaultHost()
protected String getDefaultHost()
Type | Description |
String |
getDefaultProject()
protected String getDefaultProject()
Type | Description |
String |
getDefaultQueryOptions(DatabaseId databaseId)
public ExecuteSqlRequest.QueryOptions getDefaultQueryOptions(DatabaseId databaseId)
Returns the default query options to use for the specific database.
Name | Description |
databaseId | DatabaseId |
Type | Description |
ExecuteSqlRequest.QueryOptions |
getEndpoint()
public String getEndpoint()
Type | Description |
String |
getGrpcGcpOptions()
public GcpManagedChannelOptions getGrpcGcpOptions()
Type | Description |
com.google.cloud.grpc.GcpManagedChannelOptions |
getInstanceAdminStubSettings()
public InstanceAdminStubSettings getInstanceAdminStubSettings()
Type | Description |
InstanceAdminStubSettings |
getInterceptorProvider()
public GrpcInterceptorProvider getInterceptorProvider()
Type | Description |
GrpcInterceptorProvider |
getNumChannels()
public int getNumChannels()
Type | Description |
int |
getPartitionedDmlTimeout()
public Duration getPartitionedDmlTimeout()
Type | Description |
org.threeten.bp.Duration |
getPrefetchChunks()
public int getPrefetchChunks()
Type | Description |
int |
getRetryAdministrativeRequestsSettings()
public RetrySettings getRetryAdministrativeRequestsSettings()
Type | Description |
RetrySettings |
getScopes()
public Set<String> getScopes()
Type | Description |
Set<String> |
getSessionLabels()
public Map<String,String> getSessionLabels()
Type | Description |
Map<String,String> |
getSessionPoolOptions()
public SessionPoolOptions getSessionPoolOptions()
Type | Description |
SessionPoolOptions |
getSpannerRpcV1()
protected SpannerRpc getSpannerRpcV1()
Type | Description |
SpannerRpc |
getSpannerStubSettings()
public SpannerStubSettings getSpannerStubSettings()
Type | Description |
SpannerStubSettings |
getTransportChannelExecutorThreadNameFormat()
public String getTransportChannelExecutorThreadNameFormat()
Type | Description |
String |
isAutoThrottleAdministrativeRequests()
public boolean isAutoThrottleAdministrativeRequests()
Type | Description |
boolean |
isGrpcGcpExtensionEnabled()
public boolean isGrpcGcpExtensionEnabled()
Type | Description |
boolean |
isTrackTransactionStarter()
public boolean isTrackTransactionStarter()
Type | Description |
boolean |
shouldRefreshRpc(ServiceRpc cachedRpc)
protected boolean shouldRefreshRpc(ServiceRpc cachedRpc)
Name | Description |
cachedRpc | com.google.cloud.ServiceRpc |
Type | Description |
boolean |
|
shouldRefreshService(Spanner cachedService)
protected boolean shouldRefreshService(Spanner cachedService)
Name | Description |
cachedService | Spanner |
Type | Description |
boolean |
|
toBuilder()
public SpannerOptions.Builder toBuilder()
Type | Description |
SpannerOptions.Builder |