org.apache.accumulo.server.zookeeper
Class ZooReaderWriter
java.lang.Object
org.apache.accumulo.core.zookeeper.ZooReader
org.apache.accumulo.server.zookeeper.ZooReaderWriter
- All Implemented Interfaces:
- IZooReader, IZooReaderWriter
public class ZooReaderWriter
- extends ZooReader
- implements IZooReaderWriter
Method Summary |
void |
delete(String path,
int version)
|
static ZooReaderWriter |
getInstance()
|
static IZooReaderWriter |
getRetryingInstance()
get an instance that retries when zookeeper connection errors occur |
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 |
putEphemeralSequential(String zPath,
byte[] data)
|
void |
putPersistentData(String zPath,
byte[] data,
int version,
ZooUtil.NodeExistsPolicy policy)
|
boolean |
putPersistentData(String zPath,
byte[] data,
ZooUtil.NodeExistsPolicy policy)
Create a persistent node with the default ACL |
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,
int version,
ZooUtil.NodeMissingPolicy policy)
|
void |
recursiveDelete(String zPath,
ZooUtil.NodeMissingPolicy policy)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZooReaderWriter
public ZooReaderWriter(String string,
int timeInMillis,
String auth)
getZooKeeper
public org.apache.zookeeper.ZooKeeper getZooKeeper()
- Specified by:
getZooKeeper
in interface IZooReaderWriter
- Overrides:
getZooKeeper
in class ZooReader
recursiveDelete
public void recursiveDelete(String zPath,
ZooUtil.NodeMissingPolicy policy)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Specified by:
recursiveDelete
in interface IZooReaderWriter
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
recursiveDelete
public void recursiveDelete(String zPath,
int version,
ZooUtil.NodeMissingPolicy policy)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Specified by:
recursiveDelete
in interface IZooReaderWriter
- 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
- Specified by:
putPersistentData
in interface IZooReaderWriter
- 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
- Specified by:
putPrivatePersistentData
in interface IZooReaderWriter
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
putPersistentData
public void putPersistentData(String zPath,
byte[] data,
int version,
ZooUtil.NodeExistsPolicy policy)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Specified by:
putPersistentData
in interface IZooReaderWriter
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
putPersistentSequential
public String putPersistentSequential(String zPath,
byte[] data)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Specified by:
putPersistentSequential
in interface IZooReaderWriter
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
putEphemeralSequential
public String putEphemeralSequential(String zPath,
byte[] data)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Specified by:
putEphemeralSequential
in interface IZooReaderWriter
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
recursiveCopyPersistent
public void recursiveCopyPersistent(String source,
String destination,
ZooUtil.NodeExistsPolicy policy)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Specified by:
recursiveCopyPersistent
in interface IZooReaderWriter
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
delete
public void delete(String path,
int version)
throws InterruptedException,
org.apache.zookeeper.KeeperException
- Specified by:
delete
in interface IZooReaderWriter
- 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
- Specified by:
mutate
in interface IZooReaderWriter
- Throws:
Exception
getInstance
public static ZooReaderWriter getInstance()
getRetryingInstance
public static IZooReaderWriter getRetryingInstance()
- get an instance that retries when zookeeper connection errors occur
- Returns:
- an instance that retries when Zookeeper connection errors occur.
isLockHeld
public boolean isLockHeld(ZooUtil.LockID lockID)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Specified by:
isLockHeld
in interface IZooReaderWriter
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
mkdirs
public void mkdirs(String path)
throws org.apache.zookeeper.KeeperException,
InterruptedException
- Specified by:
mkdirs
in interface IZooReaderWriter
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.