| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Client.Builder |
authenticator(Authenticator authenticator) |
Client.Builder |
bootstrapTimeout(Duration bootstrapTimeout)
Time to wait for first configuration during bootstrap.
|
Client.Builder |
bucket(String bucket)
The name of the bucket to use.
|
Client.Builder |
bufferAckWatermark(int watermark)
The buffer acknowledge watermark in percent.
|
Client |
build()
Create the client instance ready to use.
|
Client.Builder |
collectionIds(Collection<Long> collectionIds)
Configures the client to stream only from the collections identified by the given IDs.
|
Client.Builder |
collectionIds(long... collectionIds)
Configures the client to stream only from the collections identified by the given IDs.
|
Client.Builder |
collectionNames(Collection<String> qualifiedCollectionNames) |
Client.Builder |
collectionNames(String... qualifiedCollectionNames) |
Client.Builder |
collectionsAware(boolean enable)
Controls whether the client operates in collections-aware mode (defaults to false).
|
Client.Builder |
compression(CompressionMode compressionMode)
Sets the compression mode for message values sent by Couchbase Server.
|
Client.Builder |
configRefreshInterval(Duration configRefreshInterval)
When connecting to versions of Couchbase Server older than 5.5,
the DCP client polls the server for cluster topology config changes
at the specified interval.
|
Client.Builder |
connectionNameGenerator(ConnectionNameGenerator connectionNameGenerator)
If specific names for DCP connections should be generated, a custom one can be provided.
|
Client.Builder |
connectionString(String connectionString)
Connection string to bootstrap with.
|
Client.Builder |
controlParam(DcpControl.Names name,
Object value)
Set all kinds of DCP control params - check their description for more information.
|
Client.Builder |
credentials(String username,
String password) |
Client.Builder |
credentialsProvider(CredentialsProvider credentialsProvider) |
Client.Builder |
dcpChannelsReconnectDelay(Delay ignored)
Deprecated.
Doesn't do anything.
|
Client.Builder |
dcpChannelsReconnectMaxAttempts(int dcpChannelsReconnectMaxAttempts)
The maximum number of reconnect attempts for DCP channels
|
Client.Builder |
eventBus(EventBus eventBus)
Sets the event bus to an alternative implementation.
|
Client.Builder |
eventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
Sets a custom event loop group.
|
Client.Builder |
flowControl(int bufferSizeInBytes)
Enables
flow control with the specified buffer size (in bytes) and a reasonable
default buffer ACK threshold.
|
Client.Builder |
hostnames(List<String> addresses)
Deprecated.
use
seedNodes(Collection) instead. |
Client.Builder |
hostnames(String... addresses)
Deprecated.
use
seedNodes(String...) instead. |
Client.Builder |
meterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
Specifies the registry the client should use when tracking metrics.
|
Client.Builder |
mitigateRollbacks(long persistencePollingInterval,
TimeUnit unit)
Enables rollback mitigation with the specified persistence polling interval.
|
Client.Builder |
networkResolution(NetworkResolution nr)
Network selection strategy for connecting to clusters whose nodes have alternate hostnames.
|
Client.Builder |
noValue(boolean noValue)
If the argument is true, configures the client to receive only
document keys and metadata (no contents).
|
Client.Builder |
poolBuffers(boolean pool)
If buffer pooling should be enabled (yes by default).
|
Client.Builder |
scopeId(long scopeId)
Configures the client to stream only from the scope identified by the given ID.
|
Client.Builder |
scopeName(String scopeName)
Configures the client to stream only from the scope identified by the given ID.
|
Client.Builder |
securityConfig(SecurityConfig.Builder securityConfigBuilder)
Sets the TLS configutation options (from a builder, for convenience)
|
Client.Builder |
securityConfig(SecurityConfig securityConfig)
Sets the TLS configutation options
|
Client.Builder |
seedNodes(Collection<String> addresses)
Sets the addresses of the Couchbase Server nodes to bootstrap against.
|
Client.Builder |
seedNodes(String... addresses)
Sets the addresses of the Couchbase Server nodes to bootstrap against.
|
Client.Builder |
socketConnectTimeout(long socketConnectTimeout)
Sets a custom socket connect timeout.
|
Client.Builder |
userAgent(String productName,
String productVersion,
String... comments)
Sets the product information to include in the DCP client's User Agent
string.
|
Client.Builder |
xattrs(boolean xattrs)
If the argument is true, configures the client to receive
extended attributes (XATTRS).
|
public Client.Builder noValue(boolean noValue)
Defaults to false.
Client.Builder for nice chainability.public Client.Builder xattrs(boolean xattrs)
Defaults to false.
If set to true, users of the low-level API may call
MessageUtil.getContentAndXattrs(ByteBuf)
to parse the content and XATTRs of mutation requests.
Users of the high-level API may view XATTRs by calling
DocumentChange.getXattrs().
Client.Builder for nice chainability.public Client.Builder bufferAckWatermark(int watermark)
watermark - between 0 and 100, needs to be > 0 if flow control is enabled.Client.Builder for nice chainability.public Client.Builder seedNodes(Collection<String> addresses)
If a port is specified, it must be the KV service port.
The port may be omitted if Couchbase is listening on the standard KV ports (11210 and 11207 for insecure and TLS connections, respectively).
addresses - seed nodes.Client.Builder for nice chainability.public Client.Builder seedNodes(String... addresses)
If a port is specified, it must be the KV service port.
The port may be omitted if Couchbase is listening on the standard KV ports (11210 and 11207 for insecure and TLS connections, respectively).
addresses - seed nodes.Client.Builder for nice chainability.@Deprecated public Client.Builder hostnames(List<String> addresses)
seedNodes(Collection) instead.@Deprecated public Client.Builder hostnames(String... addresses)
seedNodes(String...) instead.public Client.Builder connectionString(String connectionString)
Note: it overrides list of addresses defined by seedNodes(Collection).
Connection string specification defined in SDK-RFC-11: https://github.com/couchbaselabs/sdk-rfcs/blob/master/rfc/0011-connection-string.md
connectionString - seed nodes.Client.Builder for nice chainability.public Client.Builder networkResolution(NetworkResolution nr)
Defaults to NetworkResolution.AUTO which attempts to infer the correct network name
by comparing the hostnames reported by Couchbase against the hostnames used to connect to the cluster.
public Client.Builder eventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
If more than one client is initialized and runs at the same time, you may see better performance if you create a single event loop group for the clients to share.
eventLoopGroup - the group that should be used.Client.Builder for nice chainability.public Client.Builder bucket(String bucket)
bucket - name of the bucketClient.Builder for nice chainability.public Client.Builder collectionsAware(boolean enable)
A client that is not collections-aware only receives events from the default collection.
A collections-aware client receives events from all collections (or the subset specified by
the collections/scope filter, configured separately). In this mode, users of the low-level API
are responsible for handling "DCP System Event" and "DCP Seqno Advanced" events in their
ControlEventHandler. Users of the high-level API should implement
DatabaseChangeListener.onSeqnoAdvanced(com.couchbase.client.dcp.highlevel.SeqnoAdvanced).
It is fine to enable collections awareness even when connecting to a server that does not support collections, as long as no collections/scope filter is configured.
Client.Builder for nice chainability.scopeId(long),
scopeName(String),
collectionIds(Collection),
collectionNames(Collection)public Client.Builder collectionNames(Collection<String> qualifiedCollectionNames)
public Client.Builder collectionNames(String... qualifiedCollectionNames)
public Client.Builder collectionIds(Collection<Long> collectionIds)
collectionIds - IDs of the collections to stream.Client.Builder for nice chainability.public Client.Builder collectionIds(long... collectionIds)
collectionIds - IDs of the collections to stream.Client.Builder for nice chainability.public Client.Builder scopeName(String scopeName)
scopeName - name of the scope to stream (may be null, in which case this method has no effect)Client.Builder for nice chainability.public Client.Builder scopeId(long scopeId)
scopeId - IDs of the scope to stream.Client.Builder for nice chainability.public Client.Builder credentials(String username, String password)
public Client.Builder credentialsProvider(CredentialsProvider credentialsProvider)
public Client.Builder authenticator(Authenticator authenticator)
public Client.Builder userAgent(String productName, String productVersion, String... comments)
The product name may consist of alpha-numeric ASCII characters, plus
the following special characters: !#$%&'*+-.^_`|~
Invalid characters will be converted to underscores.
Comments may optionally convey additional context, such as the name of the bucket being streamed or some other information about the client.
Client.Builder for nice chainability.public Client.Builder connectionNameGenerator(ConnectionNameGenerator connectionNameGenerator)
connectionNameGenerator - custom generator.Client.Builder for nice chainability.public Client.Builder controlParam(DcpControl.Names name, Object value)
name - the name of the paramvalue - the value of the paramClient.Builder for nice chainability.public Client.Builder compression(CompressionMode compressionMode)
CompressionMode.ENABLED.public Client.Builder poolBuffers(boolean pool)
pool - enable or disable buffer pooling.Client.Builder for nice chainability.public Client.Builder socketConnectTimeout(long socketConnectTimeout)
socketConnectTimeout - the socket connect timeout in milliseconds.public Client.Builder bootstrapTimeout(Duration bootstrapTimeout)
public Client.Builder configRefreshInterval(Duration configRefreshInterval)
When connecting to modern versions of Couchbase Server, calling this method has no effect.
configRefreshInterval - time between config refresh requests.
Must be between 1 second and 2 minutes (inclusive).public Client.Builder dcpChannelsReconnectMaxAttempts(int dcpChannelsReconnectMaxAttempts)
dcpChannelsReconnectMaxAttempts - @Deprecated public Client.Builder dcpChannelsReconnectDelay(Delay ignored)
public Client.Builder eventBus(EventBus eventBus)
This setting should only be tweaked in advanced cases.
public Client.Builder securityConfig(SecurityConfig securityConfig)
public Client.Builder securityConfig(SecurityConfig.Builder securityConfigBuilder)
public Client.Builder mitigateRollbacks(long persistencePollingInterval, TimeUnit unit)
flowControl(int).
When rollback mitigation is enabled, stream events will not be propagated to the
DataEventHandler or ControlEventHandler until the event has been
persisted to disk on the active and all replica nodes.
To observe persistence, the client will poll each node at the given interval.
If a partition instance becomes unavailable, event propagation will pause until the cluster stabilizes. Because recovery may take a long time, flow control is required so the client need not buffer an indeterminately large number of events.public Client.Builder flowControl(int bufferSizeInBytes)
bufferAckWatermark(int).bufferSizeInBytes - The amount of data the server will send before requiring an ACKChannelFlowControllerpublic Client.Builder meterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
public Client build()
Copyright © 2021 Couchbase, Inc.. All rights reserved.