public class ClusterManagerBuilder
extends java.lang.Object
ClusterManager
.
If a configuration setting is not overridden, the default one will be
applied automatically.Constructor and Description |
---|
ClusterManagerBuilder() |
Modifier and Type | Method and Description |
---|---|
ClusterManager |
build(java.util.List<java.net.URI> nodes,
java.lang.String username,
java.lang.String password)
Builder a
ClusterManager . |
int |
getConnectionsPerNode()
Returns the max connections per node.
|
int |
getConnectionTimeout()
Returns the connection timeout.
|
int |
getIoThreadCount()
Returns the HTTP IO (worker) count.
|
int |
getSocketTimeout()
Returns the socket timeout for a connection.
|
boolean |
getTcpNoDelay()
Whether TCP NODELAY is used or not.
|
ClusterManagerBuilder |
setConnectionsPerNode(int connectionsPerNode)
The maximum number of parallel connections per node to open (5 per
default).
|
ClusterManagerBuilder |
setConnectionTimeout(int connectionTimeout)
Set the HTTP connection timeout (2 minutes by default).
|
ClusterManagerBuilder |
setIoThreadCount(int ioThreadCount)
The number of IO worker threads to use (1 by default).
|
ClusterManagerBuilder |
setSocketTimeout(int socketTimeout)
The HTTP connection socket timeout (2 minutes by default).
|
ClusterManagerBuilder |
setTcpNoDelay(boolean tcpNoDelay)
The TCP NODELAY setting (true by default).
|
public int getConnectionTimeout()
public int getSocketTimeout()
public boolean getTcpNoDelay()
public int getIoThreadCount()
public int getConnectionsPerNode()
public ClusterManagerBuilder setConnectionTimeout(int connectionTimeout)
connectionTimeout
- the timeout of the connection.public ClusterManagerBuilder setSocketTimeout(int socketTimeout)
socketTimeout
- the timeout of the socket on connect.public ClusterManagerBuilder setTcpNoDelay(boolean tcpNoDelay)
tcpNoDelay
- the tcp nodelay setting.public ClusterManagerBuilder setIoThreadCount(int ioThreadCount)
ioThreadCount
- io thread worker count.public ClusterManagerBuilder setConnectionsPerNode(int connectionsPerNode)
connectionsPerNode
- number of connections.public ClusterManager build(java.util.List<java.net.URI> nodes, java.lang.String username, java.lang.String password)
ClusterManager
.nodes
- the list of nodes in the cluster to connect to.username
- the admin username.password
- the admin password.ClusterManager
.Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.