Class IoConfig.Builder
- Enclosing class:
IoConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanalyticsCircuitBreakerConfig(CircuitBreakerConfig.Builder analyticsCircuitBreakerConfig) Deprecated.analyticsCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the analytics circuit breaker by passing its config builder to the given consumer.backupCircuitBreakerConfig(CircuitBreakerConfig.Builder backupCircuitBreakerConfig) Deprecated.Please usebackupCircuitBreakerConfig(Consumer)instead.backupCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the backup circuit breaker by passing its config builder to the given consumer.build()captureTraffic(ServiceType... serviceTypes) Captures and logs network traffic for the specified services (or all services if none are specified).configIdleRedialTimeout(Duration configIdleRedialTimeout) configPollInterval(Duration configPollInterval) enableDnsSrv(boolean dnsSrvEnabled) enableMutationTokens(boolean mutationTokensEnabled) Configures whether mutation tokens will be returned from the server for all mutation operations.enableTcpKeepAlives(boolean tcpKeepAlivesEnabled) Whether to use TCP keepalive probes.eventingCircuitBreakerConfig(CircuitBreakerConfig.Builder eventingCircuitBreakerConfig) Deprecated.Please useeventingCircuitBreakerConfig(Consumer)instead.eventingCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the eventing circuit breaker by passing its config builder to the given consumer.idleHttpConnectionTimeout(Duration idleHttpConnectionTimeout) kvCircuitBreakerConfig(CircuitBreakerConfig.Builder kvCircuitBreakerConfig) Deprecated.Please usekvCircuitBreakerConfig(Consumer)instead.kvCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the key-value circuit breaker by passing its config builder to the given consumer.managerCircuitBreakerConfig(CircuitBreakerConfig.Builder managerCircuitBreakerConfig) Deprecated.Please usemanagerCircuitBreakerConfig(Consumer)instead.managerCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the manager circuit breaker by passing its config builder to the given consumer.maxHttpConnections(int maxHttpConnections) memcachedHashingStrategy(MemcachedHashingStrategy memcachedHashingStrategy) Allows to customize the hashing strategy for memcached buckets.networkResolution(NetworkResolution networkResolution) numKvConnections(int numKvConnections) queryCircuitBreakerConfig(CircuitBreakerConfig.Builder queryCircuitBreakerConfig) Deprecated.Please usequeryCircuitBreakerConfig(Consumer)instead.queryCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the query circuit breaker by passing its config builder to the given consumer.searchCircuitBreakerConfig(CircuitBreakerConfig.Builder searchCircuitBreakerConfig) Deprecated.Please usesearchCircuitBreakerConfig(Consumer)instead.searchCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the search circuit breaker by passing its config builder to the given consumer.tcpKeepAliveCount(int tcpKeepAliveCount) The maximum number of keepalive probes TCP should send before dropping the connection (TCP_KEEPCNT / tcp_keepalive_probes).tcpKeepAliveInterval(Duration tcpKeepAliveInterval) The time between individual keepalive probes.tcpKeepAliveTime(Duration tcpKeepAliveTime) The time the connection needs to remain idle before TCP starts sending keepalive probes, ifenableTcpKeepAlives(boolean)is set to true (TCP_KEEPIDLE / tcp_keepalive_time).tcpUserTimeout(Duration tcpUserTimeout) The maximum amount of time that transmitted data may remain unacknowledged, or buffered data may remain untransmitted (due to zero window size) before TCP will forcibly close the corresponding connection and return ETIMEDOUT to the application.timerConfig(Consumer<TimerConfig.Builder> builderConsumer) Configures the backup circuit breaker by passing its config builder to the given consumer.viewCircuitBreakerConfig(CircuitBreakerConfig.Builder viewCircuitBreakerConfig) Deprecated.Please useviewCircuitBreakerConfig(Consumer)instead.viewCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the views circuit breaker by passing its config builder to the given consumer.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
-
configPollInterval
-
enableMutationTokens
Configures whether mutation tokens will be returned from the server for all mutation operations.- Returns:
- this, for chaining
-
enableDnsSrv
-
enableTcpKeepAlives
Whether to use TCP keepalive probes.Defaults to true.
-
tcpKeepAliveTime
The time the connection needs to remain idle before TCP starts sending keepalive probes, ifenableTcpKeepAlives(boolean)is set to true (TCP_KEEPIDLE / tcp_keepalive_time).Resolution: seconds.
Defaults to 1 minute.
Please note that this setting only propagates to the OS on Linux when the epoll transport is used. On all other platforms, the OS-configured time is used (and you need to tune it there if you want to customize the default behavior).
- Parameters:
tcpKeepAliveTime- the custom keepalive time.- Returns:
- this builder for chaining purposes.
- See Also:
-
tcpKeepAliveInterval
The time between individual keepalive probes. (TCP_KEEPINTVL / tcp_keepalive_intvl). Used only ifenableTcpKeepAlives(boolean)is set to true.Resolution: seconds.
Defaults to zero, in which case the OS-level default is used.
Please note that this setting only propagates to the OS on Linux when the epoll transport is used. On all other platforms, the OS-configured time is used (and you need to tune it there if you want to customize the default behavior).
- Parameters:
tcpKeepAliveInterval- the custom keepalive time.- Returns:
- this builder for chaining purposes.
- See Also:
-
tcpKeepAliveCount
The maximum number of keepalive probes TCP should send before dropping the connection (TCP_KEEPCNT / tcp_keepalive_probes). Used only ifenableTcpKeepAlives(boolean)is set to true.Defaults to zero, in which case the OS-level default is used.
Please note that this setting only propagates to the OS on Linux when the epoll transport is used. On all other platforms, the OS-configured time is used (and you need to tune it there if you want to customize the default behavior).
- Parameters:
tcpKeepAliveCount- The maximum number of probes, or zero for the OS default.- Returns:
- this builder for chaining purposes.
- See Also:
-
tcpUserTimeout
The maximum amount of time that transmitted data may remain unacknowledged, or buffered data may remain untransmitted (due to zero window size) before TCP will forcibly close the corresponding connection and return ETIMEDOUT to the application.This setting will also be used in the Linux kernel's calculation of when idle connections are reset during keepalive transmissions.
Resolution: milliseconds.
Defaults to 20 seconds.
Please note that this setting only propagates to the OS on Linux when the epoll transport is used. On all other platforms, the OS-configured time is used (and you need to tune it there if you want to customize the default behavior).
- Parameters:
tcpUserTimeout- The desired timeout, orDuration.zero()for the OS default.- Returns:
- this builder for chaining purposes.
- See Also:
-
kvCircuitBreakerConfig
Deprecated.Please usekvCircuitBreakerConfig(Consumer)instead.Configures aCircuitBreakerto use for key-value operations.- Returns:
- this, for chaining
-
kvCircuitBreakerConfig
public IoConfig.Builder kvCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the key-value circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
kvCircuitBreakerConfig
-
queryCircuitBreakerConfig
public IoConfig.Builder queryCircuitBreakerConfig(CircuitBreakerConfig.Builder queryCircuitBreakerConfig) Deprecated.Please usequeryCircuitBreakerConfig(Consumer)instead.Configures aCircuitBreakerto use for query operations.- Returns:
- this, for chaining
-
queryCircuitBreakerConfig
public IoConfig.Builder queryCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the query circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
queryCircuitBreakerConfig
-
viewCircuitBreakerConfig
public IoConfig.Builder viewCircuitBreakerConfig(CircuitBreakerConfig.Builder viewCircuitBreakerConfig) Deprecated.Please useviewCircuitBreakerConfig(Consumer)instead.Configures aCircuitBreakerto use for view operations.- Returns:
- this, for chaining
-
viewCircuitBreakerConfig
public IoConfig.Builder viewCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the views circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
viewCircuitBreakerConfig
-
searchCircuitBreakerConfig
public IoConfig.Builder searchCircuitBreakerConfig(CircuitBreakerConfig.Builder searchCircuitBreakerConfig) Deprecated.Please usesearchCircuitBreakerConfig(Consumer)instead.Configures aCircuitBreakerto use for search operations.- Returns:
- this, for chaining
-
searchCircuitBreakerConfig
public IoConfig.Builder searchCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the search circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
searchCircuitBreakerConfig
-
analyticsCircuitBreakerConfig
public IoConfig.Builder analyticsCircuitBreakerConfig(CircuitBreakerConfig.Builder analyticsCircuitBreakerConfig) Deprecated.Please useanalyticsCircuitBreakerConfig(Consumer)instead.Configures aCircuitBreakerto use for analytics operations.- Returns:
- this, for chaining
-
analyticsCircuitBreakerConfig
public IoConfig.Builder analyticsCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the analytics circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
analyticsCircuitBreakerConfig
-
managerCircuitBreakerConfig
public IoConfig.Builder managerCircuitBreakerConfig(CircuitBreakerConfig.Builder managerCircuitBreakerConfig) Deprecated.Please usemanagerCircuitBreakerConfig(Consumer)instead.Configures aCircuitBreakerto use for manager operations.- Returns:
- this, for chaining
-
managerCircuitBreakerConfig
public IoConfig.Builder managerCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the manager circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
managerCircuitBreakerConfig
-
eventingCircuitBreakerConfig
public IoConfig.Builder eventingCircuitBreakerConfig(CircuitBreakerConfig.Builder eventingCircuitBreakerConfig) Deprecated.Please useeventingCircuitBreakerConfig(Consumer)instead.Configures aCircuitBreakerto use for eventing operations.- Returns:
- this, for chaining
-
eventingCircuitBreakerConfig
public IoConfig.Builder eventingCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the eventing circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
eventingCircuitBreakerConfig
-
backupCircuitBreakerConfig
@Volatile public IoConfig.Builder backupCircuitBreakerConfig(CircuitBreakerConfig.Builder backupCircuitBreakerConfig) Deprecated.Please usebackupCircuitBreakerConfig(Consumer)instead.Configures aCircuitBreakerto use for backup operations.- Returns:
- this, for chaining
-
backupCircuitBreakerConfig
@Volatile public IoConfig.Builder backupCircuitBreakerConfig(Consumer<CircuitBreakerConfig.Builder> builderConsumer) Configures the backup circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
backupCircuitBreakerConfig
-
captureTraffic
Captures and logs network traffic for the specified services (or all services if none are specified).IMPORTANT: Captured traffic is logged to the "com.couchbase.io" category at TRACE level. To see the log messages, make sure your logging library is configured appropriately. For example, if you're using Log4j2 with XML configuration, add this as a child of the
<Loggers>element:<Logger name="com.couchbase.io" level="trace"/>
Traffic capture should only be enabled during development and for debugging purposes. When enabled it will add more overhead due to traffic parsing, logging, and analysis.
- Returns:
- this
IoConfig.Builderfor chaining purposes.
-
networkResolution
-
numKvConnections
-
maxHttpConnections
-
idleHttpConnectionTimeout
-
configIdleRedialTimeout
-
memcachedHashingStrategy
Allows to customize the hashing strategy for memcached buckets.Usually the
MemcachedHashingStrategyshould only be customized if i.e. the SDK is upgraded from Java SDK 2 and the documents in the bucket must be preserved. In this case, theSdk2CompatibleMemcachedHashingStrategymust be chosen. If it is used though, keep in mind that it is not compatible with other SDKs, so we always recommend to use the defaultStandardMemcachedHashingStrategyby default.- Parameters:
memcachedHashingStrategy- the strategy to use.- Returns:
- this
IoConfig.Builderfor chaining purposes.
-
timerConfig
Configures the backup circuit breaker by passing its config builder to the given consumer.- Returns:
- this, for chaining
-
timerConfig
-
analyticsCircuitBreakerConfig(Consumer)instead.