Package org.apache.zookeeper.server
Class DataNode
- java.lang.Object
- 
- org.apache.zookeeper.server.DataNode
 
- 
- 
Field SummaryFields Modifier and Type Field Description StatPersistedstatthe stat for this node that is persisted to disk.
 - 
Constructor SummaryConstructors Constructor Description DataNode(byte[] data, Long acl, StatPersisted stat)create a DataNode with parent, data, acls and stat
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddChild(String child)Method that inserts a child into the children setvoidcopyStat(Stat to)voiddeserialize(InputArchive archive, String tag)Set<String>getChildren()convenience methods to get the childrenbyte[]getData()longgetDigest()booleanisDigestCached()booleanremoveChild(String child)Method that removes a child from the children setvoidserialize(OutputArchive archive, String tag)voidsetChildren(HashSet<String> children)convenience method for setting the children for this datanodevoidsetDigest(long digest)voidsetDigestCached(boolean digestCached)
 
- 
- 
- 
Field Detail- 
statpublic StatPersisted stat the stat for this node that is persisted to disk.
 
- 
 - 
Constructor Detail- 
DataNodepublic DataNode(byte[] data, Long acl, StatPersisted stat)create a DataNode with parent, data, acls and stat- Parameters:
- data- the data to be set
- acl- the acls for this node
- stat- the stat for this node.
 
 
- 
 - 
Method Detail- 
addChildpublic boolean addChild(String child) Method that inserts a child into the children set- Parameters:
- child- to be inserted
- Returns:
- true if this set did not already contain the specified element
 
 - 
removeChildpublic boolean removeChild(String child) Method that removes a child from the children set- Parameters:
- child-
- Returns:
- true if this set contained the specified element
 
 - 
setChildrenpublic void setChildren(HashSet<String> children) convenience method for setting the children for this datanode- Parameters:
- children-
 
 - 
getChildrenpublic Set<String> getChildren() convenience methods to get the children- Returns:
- the children of this datanode. If the datanode has no children, empty set is returned
 
 - 
copyStatpublic void copyStat(Stat to) 
 - 
deserializepublic void deserialize(InputArchive archive, String tag) throws IOException - Specified by:
- deserializein interface- Record
- Throws:
- IOException
 
 - 
serializepublic void serialize(OutputArchive archive, String tag) throws IOException - Specified by:
- serializein interface- Record
- Throws:
- IOException
 
 - 
isDigestCachedpublic boolean isDigestCached() 
 - 
setDigestCachedpublic void setDigestCached(boolean digestCached) 
 - 
getDigestpublic long getDigest() 
 - 
setDigestpublic void setDigest(long digest) 
 - 
getDatapublic byte[] getData() 
 
- 
 
-