public class ZkUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
changeZkValue(org.apache.curator.framework.CuratorFramework client,
String path,
Function<byte[],byte[]> changeFunction,
int retryTimes,
long retryWait) |
static <T> void |
changeZkValue(org.apache.curator.framework.CuratorFramework client,
String path,
Function<T,T> changeFunction,
Function<byte[],T> decoder,
Function<T,byte[]> encoder) |
static EphemeralNode |
createEphemeralNode(org.apache.curator.framework.CuratorFramework client,
String path,
byte[] value) |
static Stream<String> |
getAllChildren(org.apache.curator.framework.CuratorFramework curator,
String parentPath) |
static Stream<org.apache.curator.framework.recipes.cache.ChildData> |
getAllChildrenWithData(org.apache.curator.framework.CuratorFramework curator,
String parentPath) |
static byte[] |
getBytesFromZk(org.apache.curator.framework.CuratorFramework client,
String path) |
static <T,X extends Throwable> |
getFromZk(org.apache.curator.framework.CuratorFramework client,
String path,
com.github.phantomthief.util.ThrowableFunction<byte[],T,X> decoder) |
static String |
getStringFromZk(org.apache.curator.framework.CuratorFramework client,
String path) |
static void |
removeFromZk(org.apache.curator.framework.CuratorFramework client,
String path) |
static void |
removeFromZk(org.apache.curator.framework.CuratorFramework client,
String path,
boolean recruitDeletedChildren) |
static void |
setToZk(org.apache.curator.framework.CuratorFramework client,
String path,
byte[] value) |
static void |
setToZk(org.apache.curator.framework.CuratorFramework client,
String path,
byte[] value,
org.apache.zookeeper.CreateMode createMode)
Deprecated.
|
public static String getStringFromZk(org.apache.curator.framework.CuratorFramework client, String path)
public static byte[] getBytesFromZk(org.apache.curator.framework.CuratorFramework client,
String path)
public static <T,X extends Throwable> T getFromZk(org.apache.curator.framework.CuratorFramework client, String path, com.github.phantomthief.util.ThrowableFunction<byte[],T,X> decoder) throws X extends Throwable
X extends Throwablepublic static void setToZk(org.apache.curator.framework.CuratorFramework client,
String path,
byte[] value)
@Deprecated public static void setToZk(org.apache.curator.framework.CuratorFramework client, String path, byte[] value, org.apache.zookeeper.CreateMode createMode)
public static EphemeralNode createEphemeralNode(org.apache.curator.framework.CuratorFramework client, String path, byte[] value) throws org.apache.zookeeper.KeeperException.NodeExistsException
org.apache.zookeeper.KeeperException.NodeExistsExceptionpublic static void removeFromZk(org.apache.curator.framework.CuratorFramework client,
String path)
public static void removeFromZk(org.apache.curator.framework.CuratorFramework client,
String path,
boolean recruitDeletedChildren)
public static <T> void changeZkValue(org.apache.curator.framework.CuratorFramework client,
String path,
Function<T,T> changeFunction,
Function<byte[],T> decoder,
Function<T,byte[]> encoder)
public static boolean changeZkValue(org.apache.curator.framework.CuratorFramework client,
String path,
Function<byte[],byte[]> changeFunction,
int retryTimes,
long retryWait)
public static Stream<org.apache.curator.framework.recipes.cache.ChildData> getAllChildrenWithData(org.apache.curator.framework.CuratorFramework curator, String parentPath)
Copyright © 2019. All rights reserved.