Package com.couchbase.client.core.env
Class DefaultCoreEnvironment.Builder<SELF extends DefaultCoreEnvironment.Builder<SELF>>
- java.lang.Object
-
- com.couchbase.client.core.env.DefaultCoreEnvironment.Builder<SELF>
-
- Enclosing class:
- DefaultCoreEnvironment
public static class DefaultCoreEnvironment.Builder<SELF extends DefaultCoreEnvironment.Builder<SELF>> extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SELF
analyticsIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the Analytics I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down.SELF
analyticsServiceConfig(AnalyticsServiceConfig analyticsServiceConfig)
Allows to set a custom configuration for the Analytics service.SELF
autoreleaseAfter(long autoreleaseAfter)
Sets the time after which any non-consumed buffers will be automatically released.SELF
bootstrapCarrierDirectPort(int bootstrapCarrierDirectPort)
If carrier publication bootstrap is enabled and not SSL, sets the port to use (default value 11210).SELF
bootstrapCarrierEnabled(boolean bootstrapCarrierEnabled)
Toggles bootstrap via carrier publication (default value true).SELF
bootstrapCarrierSslPort(int bootstrapCarrierSslPort)
If carrier publication bootstrap and SSL are enabled, sets the port to use (default value 11207).SELF
bootstrapHttpDirectPort(int bootstrapHttpDirectPort)
If Http bootstrap is enabled and not SSL, sets the port to use (default value 8091).SELF
bootstrapHttpEnabled(boolean bootstrapHttpEnabled)
Toggles bootstrap via Http (default value true).SELF
bootstrapHttpSslPort(int bootstrapHttpSslPort)
If Http bootstrap and SSL are enabled, sets the port to use (default value 18091).SELF
bufferPoolingEnabled(boolean bufferPoolingEnabled)
Forcefully disable buffer pooling by setting the value to false.DefaultCoreEnvironment
build()
SELF
callbacksOnIoPool(boolean callbacksOnIoPool)
Set to true if theObservable
callbacks should be completed on the IO event loops.SELF
certAuthEnabled(boolean certAuthEnabled)
Allows to enable X.509 client certificate authentication.SELF
compressionEnabled(boolean compressionEnabled)
Allows to enable/disable compression completely, enabled by default.SELF
compressionMinRatio(double compressionMinRatio)
Allows to adjust the ratio over which the document is sent compressed over the wire - in percent.SELF
compressionMinSize(int compressionMinSize)
Allows to adjust the minimum size of a document to be considered for compression - in bytes.SELF
computationPoolSize(int computationPoolSize)
Sets the pool size (number of threads to use) for all non blocking operations in the core and clients (default value is the number of CPUs).SELF
configPollFloorInterval(long configPollFloorInterval)
Allows to set the minimum config polling interval.SELF
configPollInterval(long configPollInterval)
Allows to set the configuration poll interval which polls the server cluster configuration proactively.SELF
continuousKeepAliveEnabled(boolean continuousKeepAliveEnabled)
Allows to enable or disable the continous emitting of keepalive messages.SELF
couchbaseCoreSendHook(CouchbaseCoreSendHook hook)
Allows to configure a custom core send hook, see the javadocs for it for more details.SELF
defaultMetricsLoggingConsumer(boolean enabled, CouchbaseLogLevel level)
SELF
defaultMetricsLoggingConsumer(boolean enabled, CouchbaseLogLevel level, LoggingConsumer.OutputFormat format)
SELF
disconnectTimeout(long disconnectTimeout)
Sets a custom disconnect timeout.SELF
eventBus(EventBus eventBus)
Sets the event bus to an alternative implementation.SELF
forceSaslPlain(boolean forceSaslPlain)
Allows to forcre the KeyValue SASL authentication method to PLAIN which is used to allow authentication against LDAP-based users.SELF
ioPool(EventLoopGroup group)
Deprecated.useioPool(EventLoopGroup, ShutdownHook)
to also provide a shutdown hook.SELF
ioPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down.SELF
ioPoolSize(int ioPoolSize)
Sets the pool size (number of threads to use) for I/O operations (default value is the number of CPUs).SELF
keepAliveErrorThreshold(long keepAliveErrorThreshold)
Allows to customize the errors on keepalive messages threshold after which the connection will be recycled.SELF
keepAliveInterval(long keepAliveIntervalMilliseconds)
Sets the time of inactivity, in milliseconds, after which some services will issue a form of keep-alive request to their corresponding server/nodes (default is 30s, values <= 0 deactivate the idle check).SELF
keepAliveTimeout(long keepAliveTimeout)
Allows to customize the timeout used for keepalive operations.SELF
keyValueServiceConfig(KeyValueServiceConfig keyValueServiceConfig)
Allows to set a custom configuration for the KV service.SELF
kvEndpoints(int kvEndpoints)
Deprecated.Please usekeyValueServiceConfig(KeyValueServiceConfig)
going forward.SELF
kvIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the KV I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down.SELF
maxRequestLifetime(long maxRequestLifetime)
Sets the maximum time in milliseconds a request is allowed to live.SELF
memcachedHashingStrategy(MemcachedHashingStrategy memcachedHashingStrategy)
Sets a custom memcached node hashing strategy, mainly used for compatibility with other clients.SELF
mutationTokensEnabled(boolean mutationTokensEnabled)
If mutation tokens are enabled, they can be used for advanced durability requirements, as well as optimized RYOW consistency.SELF
networkLatencyMetricsCollectorConfig(LatencyMetricsCollectorConfig metricsCollectorConfig)
Sets a custom configuration for theNetworkLatencyMetricsCollector
.SELF
networkResolution(NetworkResolution networkResolution)
Allows to tune the network resolution setting, pinning it to either internal or external instead of relying on the automatic mechanism.SELF
observeIntervalDelay(Delay observeIntervalDelay)
SELF
operationTracingEnabled(boolean operationTracingEnabled)
Allows to enable/disable the tracing support.SELF
operationTracingServerDurationEnabled(boolean operationTracingServerDurationEnabled)
Allows to enable/disable the negotiation of server duration-enabled tracing.SELF
orphanResponseReporter(OrphanResponseReporter orphanResponseReporter)
SELF
orphanResponseReportingEnabled(boolean orphanResponseReportingEnabled)
SELF
packageNameAndVersion(String packageNameAndVersion)
Sets the String to be used as identifier for the library namespace and version.SELF
queryEndpoints(int queryEndpoints)
Deprecated.Please usequeryServiceConfig(QueryServiceConfig)
going forward.SELF
queryIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the Query I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down.SELF
queryServiceConfig(QueryServiceConfig queryServiceConfig)
Allows to set a custom configuration for the Query service.SELF
reconnectDelay(Delay reconnectDelay)
Sets theDelay
for node reconnects (default value is a delay growing exponentially between 32ms and 4096ms).SELF
requestBufferSize(int requestBufferSize)
Sets the size of the RingBuffer structure that queues requests (default value 16384).SELF
requestBufferWaitStrategy(WaitStrategyFactory waitStrategy)
Sets a custom waiting strategy for requests.SELF
responseBufferSize(int responseBufferSize)
Sets the size of the RingBuffer structure that queues responses (default value 16384).SELF
retryDelay(Delay retryDelay)
Sets theDelay
for retries of requests (default value is a delay growing exponentially between 100us and 100ms).SELF
retryStrategy(RetryStrategy retryStrategy)
Sets theRetryStrategy
to be used during request retries (default value is aBestEffortRetryStrategy
).SELF
runtimeMetricsCollectorConfig(MetricsCollectorConfig metricsCollectorConfig)
Sets a custom configuration for theRuntimeMetricsCollector
.SELF
scheduler(rx.Scheduler scheduler)
Deprecated.useioPool(EventLoopGroup, ShutdownHook)
to also provide a shutdown hook.SELF
scheduler(rx.Scheduler scheduler, ShutdownHook shutdownHook)
Sets the Scheduler implementation for the underlying computation framework, along with the action to execute when this environment is shut down.SELF
searchEndpoints(int searchEndpoints)
Deprecated.Please usesearchServiceConfig(SearchServiceConfig)
going forward.SELF
searchIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the Search I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down.SELF
searchServiceConfig(SearchServiceConfig searchServiceConfig)
Allows to set a custom configuration for the Search service.protected SELF
self()
SELF
socketConnectTimeout(int socketConnectTimeout)
Sets a custom socket connect timeout.SELF
sslEnabled(boolean sslEnabled)
Set if SSL should be enabled (default value false).SELF
sslHostnameVerificationEnabled(boolean sslHostnameVerificationEnabled)
Allows to enable SSL hostname verification.SELF
sslKeystore(KeyStore sslKeystore)
Sets the SSL Keystore directly and not indirectly via filepath.SELF
sslKeystoreFile(String sslKeystoreFile)
Defines the location of the SSL Keystore file (default value null, none).SELF
sslKeystorePassword(String sslKeystorePassword)
Sets the SSL Keystore password to be used with the Keystore file (default value null, none).SELF
sslTruststore(KeyStore sslTruststore)
Sets the SSL Keystore for the TrustStore directly and not indirectly via filepath.SELF
sslTruststoreFile(String sslTruststoreFile)
Defines the location of the SSL TrustStore keystore file (default value null, none).SELF
sslTruststorePassword(String sslTruststorePassword)
Sets the SSL TrustStore password to be used with the Keystore file (default value null, none).SELF
tcpNodelayEnabled(boolean tcpNodelayEnabled)
If TCP_NODELAY is manually disabled, Nagle'ing will take effect on both the client and (if supported) the server side.SELF
tracer(io.opentracing.Tracer tracer)
Allows to specify a custom tracer.SELF
userAgent(String userAgent)
Sets the USER-AGENT String to be sent in HTTP requests headers (should usually not be tweaked, default value is computed from the SDKDefaultCoreEnvironment.packageNameAndVersion()
).SELF
viewEndpoints(int viewEndpoints)
Deprecated.Please useviewServiceConfig(ViewServiceConfig)
going forward.SELF
viewIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the View I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down.SELF
viewServiceConfig(ViewServiceConfig viewServiceConfig)
Allows to set a custom configuration for the View service.
-
-
-
Method Detail
-
self
protected SELF self()
-
sslEnabled
public SELF sslEnabled(boolean sslEnabled)
Set if SSL should be enabled (default value false). If true, also setsslKeystoreFile(String)
andsslKeystorePassword(String)
.
-
sslKeystoreFile
public SELF sslKeystoreFile(String sslKeystoreFile)
Defines the location of the SSL Keystore file (default value null, none). If this method is used without also specifyingsslTruststoreFile(String)
this keystore will be used to initialize both the key factory as well as the trust factory with java SSL. This needs to be the case for backwards compatibility, but if you do not need X.509 client cert authentication you might as well just usesslTruststoreFile(String)
alone.
-
sslTruststoreFile
public SELF sslTruststoreFile(String sslTruststoreFile)
Defines the location of the SSL TrustStore keystore file (default value null, none). If this method is used without also specifyingsslKeystoreFile(String)
this keystore will be used to initialize both the key factory as well as the trust factory with java SSL. Prefer this method over thesslKeystoreFile(String)
if you do not need X.509 client auth and just need server side certificate checking.
-
sslKeystorePassword
public SELF sslKeystorePassword(String sslKeystorePassword)
Sets the SSL Keystore password to be used with the Keystore file (default value null, none).- See Also:
sslKeystoreFile(String)
-
sslTruststorePassword
public SELF sslTruststorePassword(String sslTruststorePassword)
Sets the SSL TrustStore password to be used with the Keystore file (default value null, none).- See Also:
sslKeystoreFile(String)
-
sslKeystore
public SELF sslKeystore(KeyStore sslKeystore)
Sets the SSL Keystore directly and not indirectly via filepath. If this method is used without also specifyingsslTruststore(KeyStore)
this keystore will be used to initialize both the key factory as well as the trust factory with java SSL. This needs to be the case for backwards compatibility, but if you do not need X.509 client cert authentication you might as well just usesslTruststore(KeyStore)
alone.- Parameters:
sslKeystore
- the keystore to use.
-
sslTruststore
public SELF sslTruststore(KeyStore sslTruststore)
Sets the SSL Keystore for the TrustStore directly and not indirectly via filepath. If this method is used without also specifyingsslKeystore(KeyStore)
this keystore will be used to initialize both the key factory as well as the trust factory with java SSL. Prefer this method over thesslKeystore(KeyStore)
if you do not need X.509 client auth and just need server side certificate checking.- Parameters:
sslTruststore
- the keystore to use.
-
sslHostnameVerificationEnabled
public SELF sslHostnameVerificationEnabled(boolean sslHostnameVerificationEnabled)
Allows to enable SSL hostname verification.- Parameters:
sslHostnameVerificationEnabled
- true if it should be enabled.
-
bootstrapHttpEnabled
public SELF bootstrapHttpEnabled(boolean bootstrapHttpEnabled)
Toggles bootstrap via Http (default value true).
-
bootstrapCarrierEnabled
public SELF bootstrapCarrierEnabled(boolean bootstrapCarrierEnabled)
Toggles bootstrap via carrier publication (default value true).
-
bootstrapHttpDirectPort
public SELF bootstrapHttpDirectPort(int bootstrapHttpDirectPort)
If Http bootstrap is enabled and not SSL, sets the port to use (default value 8091).
-
bootstrapHttpSslPort
public SELF bootstrapHttpSslPort(int bootstrapHttpSslPort)
If Http bootstrap and SSL are enabled, sets the port to use (default value 18091).
-
bootstrapCarrierDirectPort
public SELF bootstrapCarrierDirectPort(int bootstrapCarrierDirectPort)
If carrier publication bootstrap is enabled and not SSL, sets the port to use (default value 11210).
-
bootstrapCarrierSslPort
public SELF bootstrapCarrierSslPort(int bootstrapCarrierSslPort)
If carrier publication bootstrap and SSL are enabled, sets the port to use (default value 11207).
-
ioPoolSize
public SELF ioPoolSize(int ioPoolSize)
Sets the pool size (number of threads to use) for I/O operations (default value is the number of CPUs). If there is more nodes in the cluster than the defined ioPoolSize, multiplexing will automatically happen.
-
computationPoolSize
public SELF computationPoolSize(int computationPoolSize)
Sets the pool size (number of threads to use) for all non blocking operations in the core and clients (default value is the number of CPUs). Don't size it too small since it would significantly impact performance.
-
requestBufferSize
public SELF requestBufferSize(int requestBufferSize)
Sets the size of the RingBuffer structure that queues requests (default value 16384). This is an advanced parameter that usually shouldn't need to be changed.
-
responseBufferSize
public SELF responseBufferSize(int responseBufferSize)
Sets the size of the RingBuffer structure that queues responses (default value 16384). This is an advanced parameter that usually shouldn't need to be changed
-
kvEndpoints
public SELF kvEndpoints(int kvEndpoints)
Deprecated.Please usekeyValueServiceConfig(KeyValueServiceConfig)
going forward.Sets the number of Key/Value endpoints to open per nodes in the cluster (default value 1). Only tune to more if IO has been identified as the most probable bottleneck, since it can reduce batching on the tcp/network level.
-
viewEndpoints
public SELF viewEndpoints(int viewEndpoints)
Deprecated.Please useviewServiceConfig(ViewServiceConfig)
going forward.Sets the number of View endpoints to open per node in the cluster (default value 12). Setting this to a higher number is advised in heavy view workloads.
-
queryEndpoints
public SELF queryEndpoints(int queryEndpoints)
Deprecated.Please usequeryServiceConfig(QueryServiceConfig)
going forward.Sets the number of Query (N1QL) endpoints to open per node in the cluster (default value 12). Setting this to a higher number is advised in heavy query workloads.
-
searchEndpoints
public SELF searchEndpoints(int searchEndpoints)
Deprecated.Please usesearchServiceConfig(SearchServiceConfig)
going forward.Sets the number of Search (CBFT) endpoints to open per node in the cluster (default value 12). Setting this to a higher number is advised in heavy query workloads.
-
userAgent
public SELF userAgent(String userAgent)
Sets the USER-AGENT String to be sent in HTTP requests headers (should usually not be tweaked, default value is computed from the SDKDefaultCoreEnvironment.packageNameAndVersion()
).
-
packageNameAndVersion
public SELF packageNameAndVersion(String packageNameAndVersion)
Sets the String to be used as identifier for the library namespace and version. (should usually not be tweaked, default value is computed at build time from VCS tags/commits). This is used inDefaultCoreEnvironment.userAgent()
notably.
-
reconnectDelay
public SELF reconnectDelay(Delay reconnectDelay)
Sets theDelay
for node reconnects (default value is a delay growing exponentially between 32ms and 4096ms).
-
retryDelay
public SELF retryDelay(Delay retryDelay)
Sets theDelay
for retries of requests (default value is a delay growing exponentially between 100us and 100ms).
-
ioPool
@Deprecated public SELF ioPool(EventLoopGroup group)
Deprecated.useioPool(EventLoopGroup, ShutdownHook)
to also provide a shutdown hook.Sets the I/O Pool implementation for the underlying IO framework. This is an advanced configuration that should only be used if you know what you are doing.
-
ioPool
public SELF ioPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down. This is an advanced configuration that should only be used if you know what you are doing.
-
kvIoPool
public SELF kvIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the KV I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down. This is an advanced configuration that should only be used if you know what you are doing.
-
viewIoPool
public SELF viewIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the View I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down. This is an advanced configuration that should only be used if you know what you are doing.
-
queryIoPool
public SELF queryIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the Query I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down. This is an advanced configuration that should only be used if you know what you are doing.
-
searchIoPool
public SELF searchIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the Search I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down. This is an advanced configuration that should only be used if you know what you are doing.
-
analyticsIoPool
public SELF analyticsIoPool(EventLoopGroup group, ShutdownHook shutdownHook)
Sets the Analytics I/O Pool implementation for the underlying IO framework, along with the action to execute when this environment is shut down. This is an advanced configuration that should only be used if you know what you are doing.
-
scheduler
@Deprecated public SELF scheduler(rx.Scheduler scheduler)
Deprecated.useioPool(EventLoopGroup, ShutdownHook)
to also provide a shutdown hook.Sets the Scheduler implementation for the underlying computation framework. This is an advanced configuration that should only be used if you know what you are doing.
-
scheduler
public SELF scheduler(rx.Scheduler scheduler, ShutdownHook shutdownHook)
Sets the Scheduler implementation for the underlying computation framework, along with the action to execute when this environment is shut down. This is an advanced configuration that should only be used if you know what you are doing.
-
retryStrategy
public SELF retryStrategy(RetryStrategy retryStrategy)
Sets theRetryStrategy
to be used during request retries (default value is aBestEffortRetryStrategy
).
-
maxRequestLifetime
public SELF maxRequestLifetime(long maxRequestLifetime)
Sets the maximum time in milliseconds a request is allowed to live. If the best effort retry strategy is used, the request will still be cancelled after this period to make sure that requests are not sticking around forever. Make sure it is longer than any timeout you potentially have configured. Default is 75s.
-
keepAliveInterval
public SELF keepAliveInterval(long keepAliveIntervalMilliseconds)
Sets the time of inactivity, in milliseconds, after which some services will issue a form of keep-alive request to their corresponding server/nodes (default is 30s, values <= 0 deactivate the idle check).
-
autoreleaseAfter
public SELF autoreleaseAfter(long autoreleaseAfter)
Sets the time after which any non-consumed buffers will be automatically released. Setting this to a higher value than a few seconds is not recommended since this may lead to increased garbage collection.
-
eventBus
public SELF eventBus(EventBus eventBus)
Sets the event bus to an alternative implementation. This setting should only be tweaked in advanced cases.
-
bufferPoolingEnabled
public SELF bufferPoolingEnabled(boolean bufferPoolingEnabled)
Forcefully disable buffer pooling by setting the value to false. This should not be used in general because buffer pooling is in place to reduce GC pressure during workloads. It is implemented to be used as a "last resort" if the client is suspect to a buffer leak which can terminate the application. Until a solution is found to the leak buffer pooling can be disabled at the cost of higher GC.
-
tcpNodelayEnabled
public SELF tcpNodelayEnabled(boolean tcpNodelayEnabled)
If TCP_NODELAY is manually disabled, Nagle'ing will take effect on both the client and (if supported) the server side.
-
mutationTokensEnabled
public SELF mutationTokensEnabled(boolean mutationTokensEnabled)
If mutation tokens are enabled, they can be used for advanced durability requirements, as well as optimized RYOW consistency. Note that just enabling it here won't help if the server does not support it as well. Use at least Couchbase Server 4.0. Also, consider the additional overhead of 16 bytes per mutation response (8 byte for the vbucket uuid and 8 byte for the sequence number).
-
runtimeMetricsCollectorConfig
public SELF runtimeMetricsCollectorConfig(MetricsCollectorConfig metricsCollectorConfig)
Sets a custom configuration for theRuntimeMetricsCollector
.- Parameters:
metricsCollectorConfig
- the custom configuration
-
networkLatencyMetricsCollectorConfig
public SELF networkLatencyMetricsCollectorConfig(LatencyMetricsCollectorConfig metricsCollectorConfig)
Sets a custom configuration for theNetworkLatencyMetricsCollector
.- Parameters:
metricsCollectorConfig
- the custom configuration for the collector.
-
defaultMetricsLoggingConsumer
public SELF defaultMetricsLoggingConsumer(boolean enabled, CouchbaseLogLevel level, LoggingConsumer.OutputFormat format)
-
defaultMetricsLoggingConsumer
public SELF defaultMetricsLoggingConsumer(boolean enabled, CouchbaseLogLevel level)
-
socketConnectTimeout
public SELF socketConnectTimeout(int socketConnectTimeout)
Sets a custom socket connect timeout.- Parameters:
socketConnectTimeout
- the socket connect timeout in milliseconds.
-
callbacksOnIoPool
public SELF callbacksOnIoPool(boolean callbacksOnIoPool)
Set to true if theObservable
callbacks should be completed on the IO event loops. Note: this is an advanced option and must be used with care. It can be used to improve performance since it removes additional scheduling overhead on the response path, but any blocking calls in the callbacks will lead to more work on the event loops itself and eventually stall them. USE WITH CARE!
-
disconnectTimeout
public SELF disconnectTimeout(long disconnectTimeout)
Sets a custom disconnect timeout.- Parameters:
disconnectTimeout
- the disconnect timeout in milliseconds.
-
requestBufferWaitStrategy
@Experimental @Public public SELF requestBufferWaitStrategy(WaitStrategyFactory waitStrategy)
Sets a custom waiting strategy for requests. Default isBlockingWaitStrategy
.- Parameters:
waitStrategy
- waiting strategy
-
memcachedHashingStrategy
public SELF memcachedHashingStrategy(MemcachedHashingStrategy memcachedHashingStrategy)
Sets a custom memcached node hashing strategy, mainly used for compatibility with other clients.- Parameters:
memcachedHashingStrategy
- the strategy to use.
-
keyValueServiceConfig
public SELF keyValueServiceConfig(KeyValueServiceConfig keyValueServiceConfig)
Allows to set a custom configuration for the KV service. SeeKeyValueServiceConfig
for more information on the possible options.- Parameters:
keyValueServiceConfig
- the config to apply.
-
viewServiceConfig
public SELF viewServiceConfig(ViewServiceConfig viewServiceConfig)
Allows to set a custom configuration for the View service. SeeViewServiceConfig
for more information on the possible options.- Parameters:
viewServiceConfig
- the config to apply.
-
queryServiceConfig
public SELF queryServiceConfig(QueryServiceConfig queryServiceConfig)
Allows to set a custom configuration for the Query service. SeeQueryServiceConfig
for more information on the possible options.- Parameters:
queryServiceConfig
- the config to apply.
-
searchServiceConfig
public SELF searchServiceConfig(SearchServiceConfig searchServiceConfig)
Allows to set a custom configuration for the Search service. SeeSearchServiceConfig
for more information on the possible options.- Parameters:
searchServiceConfig
- the config to apply.
-
analyticsServiceConfig
public SELF analyticsServiceConfig(AnalyticsServiceConfig analyticsServiceConfig)
Allows to set a custom configuration for the Analytics service. SeeAnalyticsServiceConfig
for more information on the possible options.- Parameters:
analyticsServiceConfig
- the config to apply.
-
configPollInterval
@Committed @Public public SELF configPollInterval(long configPollInterval)
Allows to set the configuration poll interval which polls the server cluster configuration proactively. Note that the interval cannot be set lower than the floor interval defined inconfigPollFloorInterval(long)
.- Parameters:
configPollInterval
- the interval in milliseconds, 0 deactivates the polling.
-
configPollFloorInterval
@Committed @Public public SELF configPollFloorInterval(long configPollFloorInterval)
Allows to set the minimum config polling interval. Note that theconfigPollInterval(long)
obviously needs to be equal or larger than this setting, otherwise intervals will be skipped.- Parameters:
configPollFloorInterval
- the interval in milliseconds.
-
certAuthEnabled
@Uncommitted @Public public SELF certAuthEnabled(boolean certAuthEnabled)
Allows to enable X.509 client certificate authentication. Needs to be used in combination withsslEnabled(boolean)
and related methods of course.
-
continuousKeepAliveEnabled
@Public @Uncommitted public SELF continuousKeepAliveEnabled(boolean continuousKeepAliveEnabled)
Allows to enable or disable the continous emitting of keepalive messages.
-
keepAliveErrorThreshold
@Public @Uncommitted public SELF keepAliveErrorThreshold(long keepAliveErrorThreshold)
Allows to customize the errors on keepalive messages threshold after which the connection will be recycled.
-
keepAliveTimeout
@Public @Uncommitted public SELF keepAliveTimeout(long keepAliveTimeout)
Allows to customize the timeout used for keepalive operations.
-
couchbaseCoreSendHook
@Public @Experimental public SELF couchbaseCoreSendHook(CouchbaseCoreSendHook hook)
Allows to configure a custom core send hook, see the javadocs for it for more details.
-
forceSaslPlain
@Public @Committed public SELF forceSaslPlain(boolean forceSaslPlain)
Allows to forcre the KeyValue SASL authentication method to PLAIN which is used to allow authentication against LDAP-based users.- Parameters:
forceSaslPlain
- true if plain should be forced, false otherwise.
-
operationTracingEnabled
@Committed public SELF operationTracingEnabled(boolean operationTracingEnabled)
Allows to enable/disable the tracing support. Note that it is enabled by default, but only activated once opentracing is on the classpath!- Parameters:
operationTracingEnabled
- enable or disable the tracing.- Returns:
- this builder for chaining purposes.
-
operationTracingServerDurationEnabled
@Committed public SELF operationTracingServerDurationEnabled(boolean operationTracingServerDurationEnabled)
Allows to enable/disable the negotiation of server duration-enabled tracing. Note that this is enabled by default, but depending on the server version may or may not be available (it is negotiated at runtime)!- Parameters:
operationTracingServerDurationEnabled
- enable or disable the server duration.- Returns:
- this builder for chaining purposes.
-
tracer
@Committed public SELF tracer(io.opentracing.Tracer tracer)
Allows to specify a custom tracer.- Parameters:
tracer
- the tracer to use.- Returns:
- this builder for chaining purposes.
-
compressionMinSize
@Public @Uncommitted public SELF compressionMinSize(int compressionMinSize)
Allows to adjust the minimum size of a document to be considered for compression - in bytes.- Parameters:
compressionMinSize
- min compression size in bytes.- Returns:
- the builder for chaining purposes.
-
compressionMinRatio
@Public @Uncommitted public SELF compressionMinRatio(double compressionMinRatio)
Allows to adjust the ratio over which the document is sent compressed over the wire - in percent.- Parameters:
compressionMinRatio
- the compression ratio in percent.- Returns:
- the builder for chaining purposes.
-
compressionEnabled
@Public @Uncommitted public SELF compressionEnabled(boolean compressionEnabled)
Allows to enable/disable compression completely, enabled by default.- Parameters:
compressionEnabled
- if compression should be enabled or disabled.- Returns:
- the builder for chaining purposes.
-
orphanResponseReportingEnabled
@Public @Committed public SELF orphanResponseReportingEnabled(boolean orphanResponseReportingEnabled)
-
orphanResponseReporter
@Public @Committed public SELF orphanResponseReporter(OrphanResponseReporter orphanResponseReporter)
-
networkResolution
@Public @Uncommitted public SELF networkResolution(NetworkResolution networkResolution)
Allows to tune the network resolution setting, pinning it to either internal or external instead of relying on the automatic mechanism.- Parameters:
networkResolution
- the network resolution to use.- Returns:
- the builder for chaining purposes.
-
build
public DefaultCoreEnvironment build()
-
-