Package org.apache.druid.curator
Class CuratorUtils
- java.lang.Object
-
- org.apache.druid.curator.CuratorUtils
-
public class CuratorUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_ZNODE_BYTES
-
Constructor Summary
Constructors Constructor Description CuratorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcreateIfNotExists(org.apache.curator.framework.CuratorFramework curatorFramework, String path, org.apache.zookeeper.CreateMode mode, byte[] rawBytes, int maxZnodeBytes)Create znode if it does not already exist.static voidcreateOrSet(org.apache.curator.framework.CuratorFramework curatorFramework, String path, org.apache.zookeeper.CreateMode mode, byte[] rawBytes, int maxZnodeBytes)Create znode if it does not already exist.static booleanisChildAdded(org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event)
-
-
-
Field Detail
-
DEFAULT_MAX_ZNODE_BYTES
public static final int DEFAULT_MAX_ZNODE_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
createIfNotExists
public static void createIfNotExists(org.apache.curator.framework.CuratorFramework curatorFramework, String path, org.apache.zookeeper.CreateMode mode, byte[] rawBytes, int maxZnodeBytes) throws ExceptionCreate znode if it does not already exist. If it does already exist, this does nothing. In particular, the existing znode may have a different payload or create mode.- Parameters:
curatorFramework- curatorpath- pathmode- create moderawBytes- payloadmaxZnodeBytes- maximum payload size- Throws:
IllegalArgumentException- if rawBytes.length > maxZnodeBytesException- if Curator throws an Exception
-
createOrSet
public static void createOrSet(org.apache.curator.framework.CuratorFramework curatorFramework, String path, org.apache.zookeeper.CreateMode mode, byte[] rawBytes, int maxZnodeBytes) throws ExceptionCreate znode if it does not already exist. If it does already exist, update the payload (but not the create mode). If someone deletes the znode while we're trying to set it, just let it stay deleted.- Parameters:
curatorFramework- curatorpath- pathmode- create moderawBytes- payloadmaxZnodeBytes- maximum payload size- Throws:
IllegalArgumentException- if rawBytes.length > maxZnodeBytesException- if Curator throws an Exception
-
isChildAdded
public static boolean isChildAdded(org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event)
-
-