public class NodeData extends Object implements Externalizable
The NodeData class provides the capability to query and update specific properties of a node without having to
fetch the entire node from the StorageSystem. This serves as a means to reduce communication costs when
subclasses of Node are complex and "heavy." This is achieved by having each NodeData maintaining the
following information:
null to fetch the desired properties.
The desired values are returned back as a NodeData object where the mapping (properties)
is now a mapping from the desired properties to their actual values.
| Modifier and Type | Field and Description |
|---|---|
byte |
nodeClassId |
String |
nodeId |
Map<String,Object> |
properties |
long |
TS |
| Constructor and Description |
|---|
NodeData() |
NodeData(NodeData_thrift n,
HashMap<Byte,Class> nodeClassMap)
Constructs a Java NodeData representation of the Thrift NodeData representation
|
NodeData(NodeData n)
Constructs a shallow copy of the NodeData that is passed in
|
NodeData(String nodeID,
byte nodeClassId) |
NodeData(String nodeId,
long ts,
byte nodeClassId) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(String property,
Object value) |
Vector<String> |
getProperties() |
Object |
getProperty(String property) |
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public String nodeId
public long TS
public byte nodeClassId
public NodeData()
public NodeData(String nodeID, byte nodeClassId)
nodeID - The id of the node that this NodeData was constructed from.nodeClassId - The id of the class of the node this NodeData was constructed from.public NodeData(String nodeId, long ts, byte nodeClassId)
nodeId - The id of the node that this NodeData was constructed from.ts - The timestamp of this NodeData's creationnodeClassId - The id of the class of the node this NodeData was constructed from.public NodeData(NodeData n)
n - The NodeData that is to be shallowly copiedpublic NodeData(NodeData_thrift n, HashMap<Byte,Class> nodeClassMap)
n - The Thrift representation of a NodeDatanodeClassMap - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOException