public class Cluster
extends java.lang.Object
Constructor and Description |
---|
Cluster() |
Cluster(long flowElectionTimeout,
java.util.concurrent.TimeUnit flowElectionTimeUnit,
java.lang.Integer flowElectionMaxNodes) |
Modifier and Type | Method and Description |
---|---|
org.apache.curator.framework.CuratorFramework |
createCuratorClient() |
Node |
createNode() |
java.util.Set<Node> |
getNodes() |
java.lang.String |
getZooKeeperConnectString() |
void |
start() |
void |
stop() |
Node |
waitForClusterCoordinator(long time,
java.util.concurrent.TimeUnit timeUnit) |
Node |
waitForPrimaryNode(long time,
java.util.concurrent.TimeUnit timeUnit) |
void |
waitUntilAllNodesConnected(long time,
java.util.concurrent.TimeUnit timeUnit)
Waits for each node in the cluster to connect.
|
public Cluster() throws java.io.IOException
java.io.IOException
public Cluster(long flowElectionTimeout, java.util.concurrent.TimeUnit flowElectionTimeUnit, java.lang.Integer flowElectionMaxNodes) throws java.io.IOException
java.io.IOException
public void start()
public void stop()
public java.lang.String getZooKeeperConnectString()
public java.util.Set<Node> getNodes()
public org.apache.curator.framework.CuratorFramework createCuratorClient()
public Node createNode()
public Node waitForClusterCoordinator(long time, java.util.concurrent.TimeUnit timeUnit)
public Node waitForPrimaryNode(long time, java.util.concurrent.TimeUnit timeUnit)
public void waitUntilAllNodesConnected(long time, java.util.concurrent.TimeUnit timeUnit)
time
- the max amount of time to wait for a node to connecttimeUnit
- the unit of time that the given time
value represents