public static class DefaultCoreEnvironment.Builder<SELF extends DefaultCoreEnvironment.Builder<SELF>> extends Object
Modifier | Constructor and Description |
---|---|
protected |
Builder() |
Modifier and Type | Method and Description |
---|---|
SELF |
analyticsIoPool(io.netty.channel.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 ).
|
SELF |
bootstrapCarrierEnabled(boolean bootstrapCarrierEnabled)
Toggles bootstrap via carrier publication (default value ).
|
SELF |
bootstrapCarrierSslPort(int bootstrapCarrierSslPort)
If carrier publication bootstrap and SSL are enabled, sets the port to use
(default value ).
|
SELF |
bootstrapHttpDirectPort(int bootstrapHttpDirectPort)
If Http bootstrap is enabled and not SSL, sets the port to use
(default value ).
|
SELF |
bootstrapHttpEnabled(boolean bootstrapHttpEnabled)
Toggles bootstrap via Http (default value ).
|
SELF |
bootstrapHttpSslPort(int bootstrapHttpSslPort)
If Http bootstrap and SSL are enabled, sets the port to use
(default value ).
|
SELF |
bufferPoolingEnabled(boolean bufferPoolingEnabled)
Forcefully disable buffer pooling by setting the value to false.
|
DefaultCoreEnvironment |
build() |
SELF |
callbacksOnIoPool(boolean callbacksOnIoPool)
Set to true if the
Observable 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(io.netty.channel.EventLoopGroup group)
Deprecated.
use
ioPool(EventLoopGroup, ShutdownHook) to also provide a shutdown hook. |
SELF |
ioPool(io.netty.channel.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 use
keyValueServiceConfig(KeyValueServiceConfig) going forward. |
SELF |
kvIoPool(io.netty.channel.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 the
NetworkLatencyMetricsCollector . |
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 use
queryServiceConfig(QueryServiceConfig) going forward. |
SELF |
queryIoPool(io.netty.channel.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 the
Delay 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 ).
|
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 ).
|
SELF |
retryDelay(Delay retryDelay)
Sets the
Delay for retries of requests (default value is a delay growing exponentially
between 100us and 100ms). |
SELF |
retryStrategy(RetryStrategy retryStrategy)
Sets the
RetryStrategy to be used during request retries
(default value is a BestEffortRetryStrategy ). |
SELF |
runtimeMetricsCollectorConfig(MetricsCollectorConfig metricsCollectorConfig)
Sets a custom configuration for the
RuntimeMetricsCollector . |
SELF |
scheduler(rx.Scheduler scheduler)
Deprecated.
use
ioPool(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 use
searchServiceConfig(SearchServiceConfig) going forward. |
SELF |
searchIoPool(io.netty.channel.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 ).
|
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 SDK
DefaultCoreEnvironment.packageNameAndVersion() ). |
SELF |
viewEndpoints(int viewEndpoints)
Deprecated.
Please use
viewServiceConfig(ViewServiceConfig) going forward. |
SELF |
viewIoPool(io.netty.channel.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.
|
protected SELF self()
public SELF sslEnabled(boolean sslEnabled)
sslKeystoreFile(String)
and sslKeystorePassword(String)
.public SELF sslKeystoreFile(String sslKeystoreFile)
sslTruststoreFile(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 use sslTruststoreFile(String)
alone.public SELF sslTruststoreFile(String sslTruststoreFile)
sslKeystoreFile(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 the sslKeystoreFile(String)
if you do not need
X.509 client auth and just need server side certificate checking.public SELF sslKeystorePassword(String sslKeystorePassword)
sslKeystoreFile(String)
public SELF sslTruststorePassword(String sslTruststorePassword)
sslKeystoreFile(String)
public SELF sslKeystore(KeyStore sslKeystore)
sslTruststore(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 use sslTruststore(KeyStore)
alone.sslKeystore
- the keystore to use.public SELF sslTruststore(KeyStore sslTruststore)
sslKeystore(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 the sslKeystore(KeyStore)
if you do not need
X.509 client auth and just need server side certificate checking.sslTruststore
- the keystore to use.public SELF bootstrapHttpEnabled(boolean bootstrapHttpEnabled)
public SELF bootstrapCarrierEnabled(boolean bootstrapCarrierEnabled)
public SELF bootstrapHttpDirectPort(int bootstrapHttpDirectPort)
public SELF bootstrapHttpSslPort(int bootstrapHttpSslPort)
public SELF bootstrapCarrierDirectPort(int bootstrapCarrierDirectPort)
public SELF bootstrapCarrierSslPort(int bootstrapCarrierSslPort)
public SELF ioPoolSize(int ioPoolSize)
public SELF computationPoolSize(int computationPoolSize)
public SELF requestBufferSize(int requestBufferSize)
public SELF responseBufferSize(int responseBufferSize)
public SELF kvEndpoints(int kvEndpoints)
keyValueServiceConfig(KeyValueServiceConfig)
going forward.public SELF viewEndpoints(int viewEndpoints)
viewServiceConfig(ViewServiceConfig)
going forward.public SELF queryEndpoints(int queryEndpoints)
queryServiceConfig(QueryServiceConfig)
going forward.public SELF searchEndpoints(int searchEndpoints)
searchServiceConfig(SearchServiceConfig)
going forward.public SELF userAgent(String userAgent)
DefaultCoreEnvironment.packageNameAndVersion()
).public SELF packageNameAndVersion(String packageNameAndVersion)
DefaultCoreEnvironment.userAgent()
notably.public SELF reconnectDelay(Delay reconnectDelay)
Delay
for node reconnects (default value is a delay growing exponentially
between 32ms and 4096ms).public SELF retryDelay(Delay retryDelay)
Delay
for retries of requests (default value is a delay growing exponentially
between 100us and 100ms).@Deprecated public SELF ioPool(io.netty.channel.EventLoopGroup group)
ioPool(EventLoopGroup, ShutdownHook)
to also provide a shutdown hook.public SELF ioPool(io.netty.channel.EventLoopGroup group, ShutdownHook shutdownHook)
public SELF kvIoPool(io.netty.channel.EventLoopGroup group, ShutdownHook shutdownHook)
public SELF viewIoPool(io.netty.channel.EventLoopGroup group, ShutdownHook shutdownHook)
public SELF queryIoPool(io.netty.channel.EventLoopGroup group, ShutdownHook shutdownHook)
public SELF searchIoPool(io.netty.channel.EventLoopGroup group, ShutdownHook shutdownHook)
public SELF analyticsIoPool(io.netty.channel.EventLoopGroup group, ShutdownHook shutdownHook)
@Deprecated public SELF scheduler(rx.Scheduler scheduler)
ioPool(EventLoopGroup, ShutdownHook)
to also provide a shutdown hook.public SELF scheduler(rx.Scheduler scheduler, ShutdownHook shutdownHook)
public SELF retryStrategy(RetryStrategy retryStrategy)
RetryStrategy
to be used during request retries
(default value is a BestEffortRetryStrategy
).public SELF maxRequestLifetime(long maxRequestLifetime)
public SELF keepAliveInterval(long keepAliveIntervalMilliseconds)
public SELF autoreleaseAfter(long autoreleaseAfter)
public SELF eventBus(EventBus eventBus)
public SELF bufferPoolingEnabled(boolean bufferPoolingEnabled)
public SELF tcpNodelayEnabled(boolean tcpNodelayEnabled)
public SELF mutationTokensEnabled(boolean mutationTokensEnabled)
public SELF runtimeMetricsCollectorConfig(MetricsCollectorConfig metricsCollectorConfig)
RuntimeMetricsCollector
.metricsCollectorConfig
- the custom configurationpublic SELF networkLatencyMetricsCollectorConfig(LatencyMetricsCollectorConfig metricsCollectorConfig)
NetworkLatencyMetricsCollector
.metricsCollectorConfig
- the custom configuration for the collector.public SELF defaultMetricsLoggingConsumer(boolean enabled, CouchbaseLogLevel level, LoggingConsumer.OutputFormat format)
public SELF defaultMetricsLoggingConsumer(boolean enabled, CouchbaseLogLevel level)
public SELF socketConnectTimeout(int socketConnectTimeout)
socketConnectTimeout
- the socket connect timeout in milliseconds.public SELF callbacksOnIoPool(boolean callbacksOnIoPool)
Observable
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!public SELF disconnectTimeout(long disconnectTimeout)
disconnectTimeout
- the disconnect timeout in milliseconds.@InterfaceStability.Experimental @InterfaceAudience.Public public SELF requestBufferWaitStrategy(WaitStrategyFactory waitStrategy)
BlockingWaitStrategy
.waitStrategy
- waiting strategypublic SELF memcachedHashingStrategy(MemcachedHashingStrategy memcachedHashingStrategy)
memcachedHashingStrategy
- the strategy to use.public SELF keyValueServiceConfig(KeyValueServiceConfig keyValueServiceConfig)
KeyValueServiceConfig
for more information on the possible options.keyValueServiceConfig
- the config to apply.public SELF viewServiceConfig(ViewServiceConfig viewServiceConfig)
ViewServiceConfig
for more information on the possible options.viewServiceConfig
- the config to apply.public SELF queryServiceConfig(QueryServiceConfig queryServiceConfig)
QueryServiceConfig
for more information on the possible options.queryServiceConfig
- the config to apply.public SELF searchServiceConfig(SearchServiceConfig searchServiceConfig)
SearchServiceConfig
for more information on the possible options.searchServiceConfig
- the config to apply.public SELF analyticsServiceConfig(AnalyticsServiceConfig analyticsServiceConfig)
AnalyticsServiceConfig
for more information on the possible options.analyticsServiceConfig
- the config to apply.@InterfaceStability.Committed @InterfaceAudience.Public public SELF configPollInterval(long configPollInterval)
configPollFloorInterval(long)
.configPollInterval
- the interval in milliseconds, 0 deactivates the polling.@InterfaceStability.Committed @InterfaceAudience.Public public SELF configPollFloorInterval(long configPollFloorInterval)
configPollInterval(long)
obviously needs to be equal
or larger than this setting, otherwise intervals will be skipped.configPollFloorInterval
- the interval in milliseconds.@InterfaceStability.Uncommitted @InterfaceAudience.Public public SELF certAuthEnabled(boolean certAuthEnabled)
sslEnabled(boolean)
and related methods of course.@InterfaceAudience.Public @InterfaceStability.Uncommitted public SELF continuousKeepAliveEnabled(boolean continuousKeepAliveEnabled)
@InterfaceAudience.Public @InterfaceStability.Uncommitted public SELF keepAliveErrorThreshold(long keepAliveErrorThreshold)
@InterfaceAudience.Public @InterfaceStability.Uncommitted public SELF keepAliveTimeout(long keepAliveTimeout)
@InterfaceAudience.Public @InterfaceStability.Experimental public SELF couchbaseCoreSendHook(CouchbaseCoreSendHook hook)
@InterfaceAudience.Public @InterfaceStability.Committed public SELF forceSaslPlain(boolean forceSaslPlain)
forceSaslPlain
- true if plain should be forced, false otherwise.@InterfaceStability.Committed public SELF operationTracingEnabled(boolean operationTracingEnabled)
operationTracingEnabled
- enable or disable the tracing.@InterfaceStability.Committed public SELF operationTracingServerDurationEnabled(boolean operationTracingServerDurationEnabled)
operationTracingServerDurationEnabled
- enable or disable the server duration.@InterfaceStability.Committed public SELF tracer(io.opentracing.Tracer tracer)
tracer
- the tracer to use.@InterfaceAudience.Public @InterfaceStability.Uncommitted public SELF compressionMinSize(int compressionMinSize)
compressionMinSize
- min compression size in bytes.@InterfaceAudience.Public @InterfaceStability.Uncommitted public SELF compressionMinRatio(double compressionMinRatio)
compressionMinRatio
- the compression ratio in percent.@InterfaceAudience.Public @InterfaceStability.Uncommitted public SELF compressionEnabled(boolean compressionEnabled)
compressionEnabled
- if compression should be enabled or disabled.@InterfaceAudience.Public @InterfaceStability.Committed public SELF orphanResponseReportingEnabled(boolean orphanResponseReportingEnabled)
@InterfaceAudience.Public @InterfaceStability.Committed public SELF orphanResponseReporter(OrphanResponseReporter orphanResponseReporter)
@InterfaceAudience.Public @InterfaceStability.Uncommitted public SELF networkResolution(NetworkResolution networkResolution)
networkResolution
- the network resolution to use.public DefaultCoreEnvironment build()
Copyright © 2019 Couchbase, Inc.. All rights reserved.