Package com.couchbase.client.dcp
Class Client.Environment
java.lang.Object
com.couchbase.client.dcp.Client.Environment
- Enclosing class:
Client
The
Client.Environment
is responsible to carry various configuration and
state information throughout the lifecycle.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionThe authenticator for the connectionTime in milliseconds to wait for first configuration during bootstrap.bucket()
Name of the bucket used.int
The watermark in percent for buffer acknowledgements.List
<com.couchbase.client.core.util.HostAndPort> Returns the node addresses to use for bootstrapping.Collection IDs to filter on, or empty for all collections.Collection names to filter on, or empty for all collections.boolean
Whether the client should operate in collections-aware modePolling interval when server does not support clustermap change notifications.Returns the flags to use when opening a DCP connection.Returns the name generator used to identify DCP sockets.com.couchbase.client.core.util.ConnectionString
Returns the current attached control event handler.Returns the currently attached data event handler.int
Returns all DCP control params set, may be empty.eventBus()
Returns the event bus where events are broadcasted on and can be published to.com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup
Returns the currently attached event loop group for IO process.ing.com.couchbase.client.core.env.NetworkResolution
Returns the configured hostname selection strategy.com.couchbase.client.core.topology.NetworkSelector
Returns the bookkeeper for observed seqno persistence.boolean
Returns true if and only if rollback mitigation / persistence polling is enabled.long
Returns the interval between observeSeqno requests.boolean
If buffer pooling is enabled.com.couchbase.client.core.topology.PortSelector
scopeId()
Scope to filter on, or empty to filter by collection IDs.Scope to filter on, or empty to filter by collection IDs.Returns the TLS configurationvoid
setControlEventHandler
(ControlEventHandler controlEventHandler) Set/Override the control event handler.void
setDataEventHandler
(DataEventHandler dataEventHandler) Set/Override the data event handler.void
setSystemEventHandler
(SystemEventHandler systemEventHandler) Set/Override the control event handler.reactor.core.publisher.Mono
<Void> shutdown()
Shut down this stateful environment.long
Socket connect timeout in milliseconds.Returns the stream event buffer used for rollback mitigation.Returns the flags to use when opening or adding a DCP stream.toString()
tracer()
-
Field Details
-
DEFAULT_BOOTSTRAP_TIMEOUT
-
DEFAULT_CONFIG_REFRESH_INTERVAL
-
DEFAULT_SOCKET_CONNECT_TIMEOUT
public static final long DEFAULT_SOCKET_CONNECT_TIMEOUT -
DEFAULT_DCP_CHANNELS_RECONNECT_DELAY
public static final reactor.util.retry.Retry DEFAULT_DCP_CHANNELS_RECONNECT_DELAY -
DEFAULT_DCP_CHANNELS_RECONNECT_MAX_ATTEMPTS
public static final int DEFAULT_DCP_CHANNELS_RECONNECT_MAX_ATTEMPTS- See Also:
-
-
Method Details
-
networkSelector
public com.couchbase.client.core.topology.NetworkSelector networkSelector() -
portSelector
public com.couchbase.client.core.topology.PortSelector portSelector() -
clusterAt
Returns the node addresses to use for bootstrapping.If the connection string is eligible for DNS SRV resolution, the DSN SRV lookup happens every time this method is called.
-
connectionString
public com.couchbase.client.core.util.ConnectionString connectionString() -
networkResolution
public com.couchbase.client.core.env.NetworkResolution networkResolution()Returns the configured hostname selection strategy. -
dataEventHandler
Returns the currently attached data event handler. -
streamEventBuffer
Returns the stream event buffer used for rollback mitigation.- Throws:
IllegalStateException
- if persistence polling / rollback mitigation is disabled
-
persistedSeqnos
Returns the bookkeeper for observed seqno persistence. -
persistencePollingIntervalMillis
public long persistencePollingIntervalMillis()Returns the interval between observeSeqno requests. Non-positive values disable persistence polling. -
persistencePollingEnabled
public boolean persistencePollingEnabled()Returns true if and only if rollback mitigation / persistence polling is enabled. -
controlEventHandler
Returns the current attached control event handler. -
connectionNameGenerator
Returns the name generator used to identify DCP sockets. -
bucket
Name of the bucket used. -
collectionsAware
public boolean collectionsAware()Whether the client should operate in collections-aware mode -
collectionIds
Collection IDs to filter on, or empty for all collections. -
collectionNames
Collection names to filter on, or empty for all collections. -
scopeId
Scope to filter on, or empty to filter by collection IDs. -
scopeName
Scope to filter on, or empty to filter by collection IDs. -
authenticator
The authenticator for the connection -
dcpControl
Returns all DCP control params set, may be empty. -
connectionFlags
Returns the flags to use when opening a DCP connection. -
streamFlags
Returns the flags to use when opening or adding a DCP stream. -
bufferAckWatermark
public int bufferAckWatermark()The watermark in percent for buffer acknowledgements. -
eventLoopGroup
public com.couchbase.client.core.deps.io.netty.channel.EventLoopGroup eventLoopGroup()Returns the currently attached event loop group for IO process.ing. -
configRefreshInterval
Polling interval when server does not support clustermap change notifications. -
bootstrapTimeout
Time in milliseconds to wait for first configuration during bootstrap. -
setDataEventHandler
Set/Override the data event handler. -
setControlEventHandler
Set/Override the control event handler. -
setSystemEventHandler
Set/Override the control event handler. -
poolBuffers
public boolean poolBuffers()If buffer pooling is enabled. -
socketConnectTimeout
public long socketConnectTimeout()Socket connect timeout in milliseconds. -
eventBus
Returns the event bus where events are broadcasted on and can be published to. -
securityConfig
Returns the TLS configuration -
tracer
-
shutdown
Shut down this stateful environment.Note that it will only release/terminate resources which are owned by the client, especially if a custom event loop group is passed in it needs to be shut down separately.
- Returns:
- a
Mono
indicating completion of the shutdown process.
-
toString
-
dcpChannelsReconnectMaxAttempts
public int dcpChannelsReconnectMaxAttempts()
-