public class KKZookeeper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log
the log
|
| Constructor and Description |
|---|
KKZookeeper()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Disconnect from the Zookeeper
|
org.apache.zookeeper.ZooKeeper |
connect(java.lang.String host,
int sessionTimeoutMS,
int connectionTimeoutMS)
Connect to the Zookeeper or Zookeeper ensemble.
|
java.lang.String |
getSolrIP()
Get a live Solr IP address (host:port).
|
java.util.List<java.lang.String> |
getSolrIPs()
Get a List of the live Solr IP addresses each in the form (host:port).
|
java.util.List<java.lang.String> |
getSolrURLs()
Get a List of the live Solr http URLs each in the form (http://host:port/).
|
org.apache.zookeeper.Watcher.Event.KeeperState |
getState() |
java.lang.String |
getStatusString()
For debugging the KKZookeeperConnect
|
void |
setState(org.apache.zookeeper.Watcher.Event.KeeperState state) |
public org.apache.zookeeper.ZooKeeper connect(java.lang.String host,
int sessionTimeoutMS,
int connectionTimeoutMS)
throws java.io.IOException,
java.lang.InterruptedException,
com.konakart.app.KKException
host - Zookeeper hosts string (IP addresses of the single Zookeeper or all of the
Zookeepers in the ensemble)sessionTimeoutMS - session timeout in millisecondsconnectionTimeoutMS - timeout in milliseconds to connect to Zookeeper ensemblejava.io.IOException - an unexpected IOException exceptionjava.lang.InterruptedException - an unexpected InterruptedException exceptioncom.konakart.app.KKException - thrown if there is a connection timeoutpublic java.util.List<java.lang.String> getSolrIPs()
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
java.lang.InterruptedException - an unexpected InterruptedException exceptionorg.apache.zookeeper.KeeperException - an unexpected KeeperException exceptionpublic java.util.List<java.lang.String> getSolrURLs()
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
java.lang.InterruptedException - an unexpected InterruptedException exceptionorg.apache.zookeeper.KeeperException - an unexpected KeeperException exceptionpublic java.lang.String getSolrIP()
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
java.lang.InterruptedException - an unexpected InterruptedException exceptionorg.apache.zookeeper.KeeperException - an unexpected KeeperException exceptionpublic java.lang.String getStatusString()
public org.apache.zookeeper.Watcher.Event.KeeperState getState()
public void setState(org.apache.zookeeper.Watcher.Event.KeeperState state)
state - the state to setpublic void close()
throws java.lang.InterruptedException
java.lang.InterruptedException - an unexpected InterruptedException exceptionCopyright © 2018 DS Data Systems UK Ltd.