public class DataTreeV1 extends Object
The tree maintains two parallel data structures: a hashtable that maps from full paths to DataNodes and a tree of DataNodes. All accesses to a path is through the hashtable. The tree is traversed only when serializing to disk.
Modifier and Type | Class and Description |
---|---|
static class |
DataTreeV1.ProcessTxnResult |
Modifier and Type | Field and Description |
---|---|
boolean |
initialized |
long |
lastProcessedZxid |
Constructor and Description |
---|
DataTreeV1() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
static void |
copyStat(Stat from,
Stat to) |
static void |
copyStatPersisted(StatPersistedV1 from,
StatPersistedV1 to) |
String |
createNode(String path,
byte[] data,
List<ACL> acl,
long ephemeralOwner,
long zxid,
long time) |
void |
deleteNode(String path) |
void |
deserialize(org.apache.jute.InputArchive ia,
String tag) |
String |
dumpEphemerals() |
List<ACL> |
getACL(String path,
Stat stat) |
ArrayList<String> |
getChildren(String path,
Stat stat,
Watcher watcher) |
byte[] |
getData(String path,
Stat stat,
Watcher watcher) |
HashSet<String> |
getEphemerals(long sessionId) |
Map<Long,HashSet<String>> |
getEphemeralsMap()
return the ephemerals for this tree
|
DataNodeV1 |
getNode(String path) |
Collection<Long> |
getSessions() |
DataTreeV1.ProcessTxnResult |
processTxn(TxnHeader header,
org.apache.jute.Record txn) |
void |
removeCnxn(Watcher watcher) |
void |
serialize(org.apache.jute.OutputArchive oa,
String tag) |
Stat |
setACL(String path,
List<ACL> acl,
int version) |
Stat |
setData(String path,
byte[] data,
int version,
long zxid,
long time) |
void |
setEphemeralsMap(Map<Long,HashSet<String>> ephemerals) |
Stat |
statNode(String path,
Watcher watcher) |
public volatile long lastProcessedZxid
public boolean initialized
public Map<Long,HashSet<String>> getEphemeralsMap()
public Collection<Long> getSessions()
public DataNodeV1 getNode(String path)
public static void copyStatPersisted(StatPersistedV1 from, StatPersistedV1 to)
public String createNode(String path, byte[] data, List<ACL> acl, long ephemeralOwner, long zxid, long time) throws KeeperException.NoNodeException, KeeperException.NodeExistsException
path
- data
- acl
- ephemeralOwner
- the session id that owns this node. -1 indicates this is
not an ephemeral node.zxid
- time
- KeeperException
KeeperException.NoNodeException
KeeperException.NodeExistsException
public void deleteNode(String path) throws KeeperException.NoNodeException
KeeperException.NoNodeException
public Stat setData(String path, byte[] data, int version, long zxid, long time) throws KeeperException.NoNodeException
KeeperException.NoNodeException
public byte[] getData(String path, Stat stat, Watcher watcher) throws KeeperException.NoNodeException
KeeperException.NoNodeException
public Stat statNode(String path, Watcher watcher) throws KeeperException.NoNodeException
KeeperException.NoNodeException
public ArrayList<String> getChildren(String path, Stat stat, Watcher watcher) throws KeeperException.NoNodeException
KeeperException.NoNodeException
public Stat setACL(String path, List<ACL> acl, int version) throws KeeperException.NoNodeException
KeeperException.NoNodeException
public List<ACL> getACL(String path, Stat stat) throws KeeperException.NoNodeException
KeeperException.NoNodeException
public DataTreeV1.ProcessTxnResult processTxn(TxnHeader header, org.apache.jute.Record txn)
public void serialize(org.apache.jute.OutputArchive oa, String tag) throws IOException, InterruptedException
IOException
InterruptedException
public void deserialize(org.apache.jute.InputArchive ia, String tag) throws IOException
IOException
public String dumpEphemerals()
public void removeCnxn(Watcher watcher)
public void clear()
Copyright © 2014 The Apache Software Foundation