T
- concrete Configuration
typepublic abstract class ClusterConfig<T extends Configuration> extends Object implements Configuration
Configuration
for a "cluster" of clients.
Holds a collection of Configuration
s, one for each node in a cluster.
Currently only supports homogeneous clusters.
Modifier and Type | Field and Description |
---|---|
static int |
UNLIMITED_CONNECTIONS
Constant for specifying unlimited maximum connection
|
Constructor and Description |
---|
ClusterConfig(int totalMaximumConnections) |
Modifier and Type | Method and Description |
---|---|
ClusterConfig<T> |
addClient(T clientConfig)
Add a new client config to the collection of client in the cluster config
|
protected abstract ClusterConfig<T> |
addHosts(String... hosts)
Convenience method for creating a cluster of hosts with a common, default
config except for host
|
protected abstract ClusterConfig<T> |
addHosts(T config,
String... hosts)
Convenience method for creating a cluster of hosts with a common
config except for host
|
List<T> |
getClients() |
int |
getTotalMaximumConnections() |
public static final int UNLIMITED_CONNECTIONS
public ClusterConfig(int totalMaximumConnections)
totalMaximumConnections
- the upper limit of connections for all nodes in the config
NOTE: set individual client limits in each client configpublic int getTotalMaximumConnections()
public ClusterConfig<T> addClient(T clientConfig)
nodeConfig
- a node config to addHTTPClientConfig
,
PBClientConfig
public List<T> getClients()
Configuration
s in
the cluster configurationprotected abstract ClusterConfig<T> addHosts(String... hosts)
hosts
- var arg String array of hostsClusterConfig
with a node for each host in
hosts
protected abstract ClusterConfig<T> addHosts(T config, String... hosts)
config
- T the common base confighosts
- var arg String array of hostsClusterConfig
with a node for each host in
hosts
Copyright © 2014. All Rights Reserved.