Package org.apache.druid.curator
Class CuratorUtils
java.lang.Object
org.apache.druid.curator.CuratorUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
DEFAULT_MAX_ZNODE_BYTES
public static final int DEFAULT_MAX_ZNODE_BYTES- See Also:
-
-
Constructor Details
-
CuratorUtils
public CuratorUtils()
-
-
Method Details
-
createIfNotExists
public static void createIfNotExists(org.apache.curator.framework.CuratorFramework curatorFramework, String path, org.apache.zookeeper.CreateMode mode, byte[] rawBytes, int maxZnodeBytes) throws Exception Create 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 Exception Create 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)
-