Modifier and Type | Field and Description |
---|---|
protected String |
lastHost |
protected List<String> |
nodes |
Constructor and Description |
---|
Cluster()
Constructor
|
Cluster(List<String> nodes)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Cluster |
add(String node)
Add a node to the cluster
|
Cluster |
add(String name,
int port)
Add a node to the cluster
|
boolean |
isEmpty() |
Cluster |
remove(String node)
Remove a node from the cluster
|
Cluster |
remove(String name,
int port)
Remove a node from the cluster
|
String |
toString() |
public Cluster()
public boolean isEmpty()
public Cluster add(String node)
node
- the service location in 'host:port' formatpublic Cluster add(String name, int port)
name
- host nameport
- service portpublic Cluster remove(String node)
node
- the service location in 'host:port' formatpublic Cluster remove(String name, int port)
name
- host nameport
- service portCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.