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(ZooKeeper zkc,
String path)
Check if a persist node exists.
|
void |
close() |
static String |
createIfAbsent(ZooKeeper zk,
String path,
byte[] data,
CreateMode createMode) |
static String |
createIfAbsent(ZooKeeper zk,
String path,
byte[] data,
CreateMode createMode,
boolean gc) |
static String |
createIfAbsent(ZooKeeper zk,
String path,
String data,
CreateMode createMode) |
static String |
createIfAbsent(ZooKeeper zk,
String path,
String data,
CreateMode createMode,
boolean gc) |
static void |
deleteIfExists(ZooKeeper zk,
String path,
int version) |
ZooKeeper |
getLocalZooKeeper() |
void |
start(ZookeeperSessionExpiredHandler sessionExpiredHandler) |
public LocalZooKeeperConnectionService(ZooKeeperClientFactory zkClientFactory, String zkConnect, long zkSessionTimeoutMillis)
public void start(ZookeeperSessionExpiredHandler sessionExpiredHandler) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic ZooKeeper getLocalZooKeeper()
public static void checkAndCreatePersistNode(ZooKeeper zkc, String path) throws KeeperException, InterruptedException
path - znode pathKeeperException - zookeeper exception.InterruptedException - zookeeper exception.public static String createIfAbsent(ZooKeeper zk, String path, String data, CreateMode createMode) throws KeeperException, InterruptedException
KeeperExceptionInterruptedExceptionpublic static String createIfAbsent(ZooKeeper zk, String path, String data, CreateMode createMode, boolean gc) throws KeeperException, InterruptedException
KeeperExceptionInterruptedExceptionpublic static String createIfAbsent(ZooKeeper zk, String path, byte[] data, CreateMode createMode) throws KeeperException, InterruptedException
KeeperExceptionInterruptedExceptionpublic static String createIfAbsent(ZooKeeper zk, String path, byte[] data, CreateMode createMode, boolean gc) throws KeeperException, InterruptedException
KeeperExceptionInterruptedExceptionpublic static void deleteIfExists(ZooKeeper zk, String path, int version) throws KeeperException, InterruptedException
KeeperExceptionInterruptedExceptionCopyright © 2017–2021 Apache Software Foundation. All rights reserved.