Class ZooReaderWriter
- java.lang.Object
-
- org.apache.accumulo.fate.zookeeper.ZooReader
-
- org.apache.accumulo.fate.zookeeper.ZooReaderWriter
-
public class ZooReaderWriter extends ZooReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceZooReaderWriter.Mutator
-
Field Summary
-
Fields inherited from class org.apache.accumulo.fate.zookeeper.ZooReader
keepers, RETRY_FACTORY, timeout
-
-
Constructor Summary
Constructors Constructor Description ZooReaderWriter(String keepers, int timeoutInMillis, String secret)ZooReaderWriter(AccumuloConfiguration conf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String path, int version)List<org.apache.zookeeper.data.ACL>getACL(String zPath, org.apache.zookeeper.data.Stat stat)org.apache.zookeeper.ZooKeepergetZooKeeper()booleanisLockHeld(ZooUtil.LockID lockID)voidmkdirs(String path)byte[]mutate(String zPath, byte[] createValue, List<org.apache.zookeeper.data.ACL> acl, ZooReaderWriter.Mutator mutator)StringputEphemeralData(String zPath, byte[] data)StringputEphemeralSequential(String zPath, byte[] data)booleanputPersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy)Create a persistent node with the default ACLbooleanputPersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy, List<org.apache.zookeeper.data.ACL> acls)StringputPersistentSequential(String zPath, byte[] data)booleanputPrivatePersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy)voidrecursiveCopyPersistent(String source, String destination, ZooUtil.NodeExistsPolicy policy)voidrecursiveDelete(String zPath, ZooUtil.NodeMissingPolicy policy)This method will delete a node and all its children from zookeeper-
Methods inherited from class org.apache.accumulo.fate.zookeeper.ZooReader
exists, exists, getChildren, getChildren, getData, getData, getRetryFactory, getStatus, getStatus, retryOrThrow, sync
-
-
-
-
Constructor Detail
-
ZooReaderWriter
public ZooReaderWriter(AccumuloConfiguration conf)
-
-
Method Detail
-
getZooKeeper
public org.apache.zookeeper.ZooKeeper getZooKeeper()
- Overrides:
getZooKeeperin classZooReader
-
getACL
public List<org.apache.zookeeper.data.ACL> getACL(String zPath, org.apache.zookeeper.data.Stat stat) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
recursiveDelete
public void recursiveDelete(String zPath, ZooUtil.NodeMissingPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
This method will delete a node and all its children from zookeeper- Parameters:
zPath- the path to delete- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPersistentData
public boolean putPersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
Create a persistent node with the default ACL- Returns:
- true if the node was created or altered; false if it was skipped
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPrivatePersistentData
public boolean putPrivatePersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPersistentData
public boolean putPersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy, List<org.apache.zookeeper.data.ACL> acls) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPersistentSequential
public String putPersistentSequential(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putEphemeralData
public String putEphemeralData(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putEphemeralSequential
public String putEphemeralSequential(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
recursiveCopyPersistent
public void recursiveCopyPersistent(String source, String destination, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
delete
public void delete(String path, int version) throws InterruptedException, org.apache.zookeeper.KeeperException
- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
mutate
public byte[] mutate(String zPath, byte[] createValue, List<org.apache.zookeeper.data.ACL> acl, ZooReaderWriter.Mutator mutator) throws Exception
- Throws:
Exception
-
isLockHeld
public boolean isLockHeld(ZooUtil.LockID lockID) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
mkdirs
public void mkdirs(String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
-