public static class SpannerOptions.Builder extends ServiceOptions.Builder<Spanner,SpannerOptions,SpannerOptions.Builder>
SpannerOptions
instances.credentials
Modifier and Type | Method and Description |
---|---|
SpannerOptions |
build() |
SpannerOptions.Builder |
setNumChannels(int numChannels)
Sets the number of gRPC channels to use.
|
SpannerOptions.Builder |
setPrefetchChunks(int prefetchChunks)
Specifying this will allow the client to prefetch up to
prefetchChunks PartialResultSet chunks for each read and query. |
SpannerOptions.Builder |
setRpcChannelFactory(SpannerOptions.RpcChannelFactory factory)
Sets the factory for creating gRPC channels.
|
SpannerOptions.Builder |
setSessionLabels(Map<String,String> sessionLabels)
Sets the labels to add to all Sessions created in this client.
|
SpannerOptions.Builder |
setSessionPoolOption(SessionPoolOptions sessionPoolOptions)
Sets the options for managing the session pool.
|
SpannerOptions.Builder |
setTransportOptions(TransportOptions transportOptions) |
self, setClock, setCredentials, setHeaderProvider, setHost, setProjectId, setRetrySettings, setServiceFactory, setServiceRpcFactory
public SpannerOptions.Builder setTransportOptions(TransportOptions transportOptions)
setTransportOptions
in class ServiceOptions.Builder<Spanner,SpannerOptions,SpannerOptions.Builder>
public SpannerOptions.Builder setRpcChannelFactory(SpannerOptions.RpcChannelFactory factory)
public SpannerOptions.Builder setNumChannels(int numChannels)
SpannerOptions
.public SpannerOptions.Builder setSessionPoolOption(SessionPoolOptions sessionPoolOptions)
SessionPoolOptions
is used.public SpannerOptions.Builder setSessionLabels(Map<String,String> sessionLabels)
sessionLabels
- Map from label key to label value. Label key and value cannot be null.
For more information on valid syntax see
api docs .public SpannerOptions.Builder setPrefetchChunks(int prefetchChunks)
prefetchChunks
PartialResultSet
chunks for each read and query. The data size of each chunk depends on the
server implementation but a good rule of thumb is that each chunk will be up to 1 MiB. Larger
values reduce the likelihood of blocking while consuming results at the cost of greater
memory consumption. prefetchChunks
should be greater than 0. To get good performance
choose a value that is large enough to allow buffering of chunks for an entire row. Apart
from the buffered chunks, there can be at most one more row buffered in the client. This can
be overriden on a per read/query basis by Options.prefetchChunks()
. If unspecified,
we will use a default value (currently 4).public SpannerOptions build()
build
in class ServiceOptions.Builder<Spanner,SpannerOptions,SpannerOptions.Builder>
Copyright © 2018 Google. All rights reserved.