|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.curator.framework.recipes.nodes.PersistentEphemeralNode
public class PersistentEphemeralNode
A persistent ephemeral node is an ephemeral node that attempts to stay present in ZooKeeper, even through connection and session interruptions.
Thanks to bbeck (https://github.com/bbeck) for the initial coding and design
| Nested Class Summary | |
|---|---|
static class |
PersistentEphemeralNode.Mode
The mode for node creation |
| Constructor Summary | |
|---|---|
PersistentEphemeralNode(org.apache.curator.framework.CuratorFramework client,
PersistentEphemeralNode.Mode mode,
String basePath,
byte[] data)
|
|
| Method Summary | |
|---|---|
void |
close()
|
String |
getActualPath()
Returns the currently set path or null if the node does not exist |
void |
setData(byte[] data)
Set data that ephemeral node should set in ZK also writes the data to the node |
void |
start()
You must call start() to initiate the persistent ephemeral node. |
boolean |
waitForInitialCreate(long timeout,
TimeUnit unit)
Block until the either initial node creation initiated by start() succeeds or
the timeout elapses. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PersistentEphemeralNode(org.apache.curator.framework.CuratorFramework client,
PersistentEphemeralNode.Mode mode,
String basePath,
byte[] data)
client - client instancemode - creation/protection modebasePath - the base path for the nodedata - data for the node| Method Detail |
|---|
public void start()
public boolean waitForInitialCreate(long timeout,
TimeUnit unit)
throws InterruptedException
start() succeeds or
the timeout elapses.
timeout - the maximum time to waitunit - time unit
InterruptedException - if the thread is interrupted
public void close()
throws IOException
close in interface CloseableIOExceptionpublic String getActualPath()
public void setData(byte[] data)
throws Exception
data - new data value
Exception - errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||