public class LocalZooKeeperConnectionService extends Object implements Closeable
| Constructor and Description |
|---|
LocalZooKeeperConnectionService(ZooKeeperClientFactory zkClientFactory,
String zkConnect,
long zkSessionTimeoutMillis) |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkAndCreatePersistNode(org.apache.zookeeper.ZooKeeper zkc,
String path)
Check if a persist node exists.
|
void |
close() |
static String |
createIfAbsent(org.apache.zookeeper.ZooKeeper zk,
String path,
byte[] data,
org.apache.zookeeper.CreateMode createMode) |
static String |
createIfAbsent(org.apache.zookeeper.ZooKeeper zk,
String path,
byte[] data,
org.apache.zookeeper.CreateMode createMode,
boolean gc) |
static String |
createIfAbsent(org.apache.zookeeper.ZooKeeper zk,
String path,
String data,
org.apache.zookeeper.CreateMode createMode) |
static String |
createIfAbsent(org.apache.zookeeper.ZooKeeper zk,
String path,
String data,
org.apache.zookeeper.CreateMode createMode,
boolean gc) |
static void |
deleteIfExists(org.apache.zookeeper.ZooKeeper zk,
String path,
int version) |
org.apache.zookeeper.ZooKeeper |
getLocalZooKeeper() |
void |
start(ZooKeeperSessionWatcher.ShutdownService shutdownService) |
public LocalZooKeeperConnectionService(ZooKeeperClientFactory zkClientFactory, String zkConnect, long zkSessionTimeoutMillis)
public void start(ZooKeeperSessionWatcher.ShutdownService shutdownService) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic org.apache.zookeeper.ZooKeeper getLocalZooKeeper()
public static void checkAndCreatePersistNode(org.apache.zookeeper.ZooKeeper zkc,
String path)
throws org.apache.zookeeper.KeeperException,
InterruptedException
path - znode pathorg.apache.zookeeper.KeeperException - zookeeper exception.InterruptedException - zookeeper exception.public static String createIfAbsent(org.apache.zookeeper.ZooKeeper zk, String path, String data, org.apache.zookeeper.CreateMode createMode) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static String createIfAbsent(org.apache.zookeeper.ZooKeeper zk, String path, String data, org.apache.zookeeper.CreateMode createMode, boolean gc) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static String createIfAbsent(org.apache.zookeeper.ZooKeeper zk, String path, byte[] data, org.apache.zookeeper.CreateMode createMode) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static String createIfAbsent(org.apache.zookeeper.ZooKeeper zk, String path, byte[] data, org.apache.zookeeper.CreateMode createMode, boolean gc) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static void deleteIfExists(org.apache.zookeeper.ZooKeeper zk,
String path,
int version)
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionCopyright © 2017–2019 Apache Software Foundation. All rights reserved.