Class ZooReaderWriter
- java.lang.Object
-
- org.apache.accumulo.fate.zookeeper.ZooReader
-
- org.apache.accumulo.fate.zookeeper.ZooReaderWriter
-
- All Implemented Interfaces:
IZooReader,IZooReaderWriter
public class ZooReaderWriter extends ZooReader implements IZooReaderWriter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.accumulo.fate.zookeeper.IZooReaderWriter
IZooReaderWriter.Mutator
-
-
Constructor Summary
Constructors Constructor Description ZooReaderWriter(String string, int timeInMillis, String scheme, byte[] auth)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String path, int version)static ZooReaderWritergetInstance(String zookeepers, int timeInMillis, String scheme, byte[] auth)org.apache.zookeeper.ZooKeepergetZooKeeper()booleanisLockHeld(ZooUtil.LockID lockID)voidmkdirs(String path)byte[]mutate(String zPath, byte[] createValue, List<org.apache.zookeeper.data.ACL> acl, IZooReaderWriter.Mutator mutator)StringputEphemeralData(String zPath, byte[] data)StringputEphemeralSequential(String zPath, byte[] data)voidputPersistentData(String zPath, byte[] data, int version, ZooUtil.NodeExistsPolicy policy)booleanputPersistentData(String zPath, byte[] data, int version, ZooUtil.NodeExistsPolicy policy, List<org.apache.zookeeper.data.ACL> acls)booleanputPersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy)Create a persistent node with the default ACLStringputPersistentSequential(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)-
Methods inherited from class org.apache.accumulo.fate.zookeeper.ZooReader
exists, exists, getACL, getChildren, getChildren, getData, getData, getData, getRetryFactory, getSession, getStatus, getStatus, retryOrThrow, sync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.accumulo.fate.zookeeper.IZooReader
exists, exists, getACL, getChildren, getChildren, getData, getData, getData, getStatus, getStatus
-
Methods inherited from interface org.apache.accumulo.fate.zookeeper.IZooReaderWriter
sync
-
-
-
-
Method Detail
-
getZooKeeper
public org.apache.zookeeper.ZooKeeper getZooKeeper()
- Specified by:
getZooKeeperin interfaceIZooReaderWriter- Overrides:
getZooKeeperin classZooReader
-
recursiveDelete
public void recursiveDelete(String zPath, ZooUtil.NodeMissingPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
recursiveDeletein interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPersistentData
public boolean putPersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
Description copied from interface:IZooReaderWriterCreate a persistent node with the default ACL- Specified by:
putPersistentDatain interfaceIZooReaderWriter- Returns:
- true if the node was created or altered; false if it was skipped
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPersistentData
public boolean putPersistentData(String zPath, byte[] data, int version, ZooUtil.NodeExistsPolicy policy, List<org.apache.zookeeper.data.ACL> acls) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
putPersistentDatain interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPrivatePersistentData
public boolean putPrivatePersistentData(String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
putPrivatePersistentDatain interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPersistentData
public void putPersistentData(String zPath, byte[] data, int version, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
putPersistentDatain interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putPersistentSequential
public String putPersistentSequential(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
putPersistentSequentialin interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putEphemeralData
public String putEphemeralData(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
putEphemeralDatain interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
putEphemeralSequential
public String putEphemeralSequential(String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
putEphemeralSequentialin interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
recursiveCopyPersistent
public void recursiveCopyPersistent(String source, String destination, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
recursiveCopyPersistentin interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
delete
public void delete(String path, int version) throws InterruptedException, org.apache.zookeeper.KeeperException
- Specified by:
deletein interfaceIZooReaderWriter- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
mutate
public byte[] mutate(String zPath, byte[] createValue, List<org.apache.zookeeper.data.ACL> acl, IZooReaderWriter.Mutator mutator) throws Exception
- Specified by:
mutatein interfaceIZooReaderWriter- Throws:
Exception
-
getInstance
public static ZooReaderWriter getInstance(String zookeepers, int timeInMillis, String scheme, byte[] auth)
-
isLockHeld
public boolean isLockHeld(ZooUtil.LockID lockID) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
isLockHeldin interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
mkdirs
public void mkdirs(String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Specified by:
mkdirsin interfaceIZooReaderWriter- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
-