|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.netflix.curator.CuratorZookeeperClient
public class CuratorZookeeperClient
A wrapper around Zookeeper that takes care of some low-level housekeeping
| Constructor Summary | |
|---|---|
CuratorZookeeperClient(String connectString,
int sessionTimeoutMs,
int connectionTimeoutMs,
org.apache.zookeeper.Watcher watcher,
RetryPolicy retryPolicy)
|
|
| Method Summary | |
|---|---|
boolean |
blockUntilConnectedOrTimedOut()
This method blocks until the connection to ZK succeeds. |
void |
close()
Close the client |
RetryPolicy |
getRetryPolicy()
Return the current retry policy |
TracerDriver |
getTracerDriver()
Return the current tracing driver |
org.apache.zookeeper.ZooKeeper |
getZooKeeper()
Return the managed ZK instance. |
boolean |
isConnected()
Returns true if the client is current connected |
RetryLoop |
newRetryLoop()
Return a new retry loop. |
void |
setRetryPolicy(RetryPolicy policy)
Change the retry policy |
void |
setTracerDriver(TracerDriver tracer)
Change the tracing driver |
void |
start()
Must be called after construction |
TimeTrace |
startTracer(String name)
Start a new tracer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CuratorZookeeperClient(String connectString,
int sessionTimeoutMs,
int connectionTimeoutMs,
org.apache.zookeeper.Watcher watcher,
RetryPolicy retryPolicy)
throws IOException
connectString - list of servers to connect tosessionTimeoutMs - session timeoutconnectionTimeoutMs - connection timeoutwatcher - default watcher or nullretryPolicy - the retry policy to use
IOException - ZooKeeper creation errors| Method Detail |
|---|
public org.apache.zookeeper.ZooKeeper getZooKeeper()
throws Exception
Exception - if the connection timeout has elapsed or an exception occurs in a background processpublic RetryLoop newRetryLoop()
public boolean isConnected()
public boolean blockUntilConnectedOrTimedOut()
throws InterruptedException
InterruptedException - interrupted while waiting
public void start()
throws Exception
IOException - errors
Exceptionpublic void close()
close in interface Closeablepublic void setRetryPolicy(RetryPolicy policy)
policy - new policypublic RetryPolicy getRetryPolicy()
public TimeTrace startTracer(String name)
name - name of the event
TimeTrace.commit() must be called)public TracerDriver getTracerDriver()
public void setTracerDriver(TracerDriver tracer)
tracer - new tracing driver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||