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 interface
ZooReaderWriter.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 void
delete(String path, int version)
List<org.apache.zookeeper.data.ACL>
getACL(String zPath, org.apache.zookeeper.data.Stat stat)
org.apache.zookeeper.ZooKeeper
getZooKeeper()
boolean
isLockHeld(ZooUtil.LockID lockID)
void
mkdirs(String path)
byte[]
mutate(String zPath, byte[] createValue, List<org.apache.zookeeper.data.ACL> acl, ZooReaderWriter.Mutator mutator)
String
putEphemeralData(String zPath, byte[] data)
String
putEphemeralSequential(String zPath, byte[] data)
boolean
putPersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy)
Create a persistent node with the default ACLboolean
putPersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy, List<org.apache.zookeeper.data.ACL> acls)
String
putPersistentSequential(String zPath, byte[] data)
boolean
putPrivatePersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy)
void
recursiveCopyPersistent(String source, String destination, ZooUtil.NodeExistsPolicy policy)
void
recursiveDelete(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:
getZooKeeper
in 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.KeeperException
InterruptedException
-
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.KeeperException
InterruptedException
-
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.KeeperException
InterruptedException
-
putPrivatePersistentData
public boolean putPrivatePersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
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.KeeperException
InterruptedException
-
putPersistentSequential
public String putPersistentSequential(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
putEphemeralData
public String putEphemeralData(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
putEphemeralSequential
public String putEphemeralSequential(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
recursiveCopyPersistent
public void recursiveCopyPersistent(String source, String destination, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
delete
public void delete(String path, int version) throws InterruptedException, org.apache.zookeeper.KeeperException
- Throws:
InterruptedException
org.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.KeeperException
InterruptedException
-
mkdirs
public void mkdirs(String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
-