public class DatanodeInfo extends DatanodeID implements Node
限定符和类型 | 类和说明 |
---|---|
static class |
DatanodeInfo.AdminStates |
限定符和类型 | 字段和说明 |
---|---|
protected DatanodeInfo.AdminStates |
adminState |
protected long |
capacity |
protected long |
dfsUsed |
protected String |
hostName
HostName as suplied by the datanode during registration as its
name.
|
protected long |
lastUpdate |
protected String |
location |
protected long |
remaining |
protected int |
xceiverCount |
EMPTY_ARRAY, infoPort, ipcPort, name, storageID
限定符 | 构造器和说明 |
---|---|
|
DatanodeInfo() |
|
DatanodeInfo(DatanodeID nodeID) |
protected |
DatanodeInfo(DatanodeID nodeID,
String location,
String hostName) |
|
DatanodeInfo(DatanodeInfo from) |
|
DatanodeInfo(String name,
String storageID,
int infoPort,
int ipcPort,
long capacity,
long dfsUsed,
long remaining,
long lastUpdate,
int xceiverCount,
String networkLocation,
String hostName,
DatanodeInfo.AdminStates adminState)
Constructor
|
限定符和类型 | 方法和说明 |
---|---|
String |
dumpDatanode()
A formatted string for printing the status of the DataNode.
|
DatanodeInfo.AdminStates |
getAdminState()
Retrieves the admin state of this node.
|
long |
getCapacity()
The raw capacity.
|
String |
getDatanodeReport()
A formatted string for reporting the status of the DataNode.
|
long |
getDfsUsed()
The used space by the data node.
|
float |
getDfsUsedPercent()
The used space by the data node as percentage of present capacity
|
String |
getHostName() |
long |
getLastUpdate()
The time when this information was accurate.
|
int |
getLevel()
Return this node's level in the tree.
|
String |
getName(boolean useHostname)
Return hostname:port if requested, ip:port otherwise
|
String |
getNameWithIpcPort(boolean useHostname)
Return hostname:ipcPort if requested, ip:ipcPort otherwise
|
String |
getNetworkLocation()
network location
|
long |
getNonDfsUsed()
The used space by the data node.
|
Node |
getParent()
Return this node's parent
|
long |
getRemaining()
The raw free space.
|
float |
getRemainingPercent()
The remaining space as percentage of configured capacity.
|
int |
getXceiverCount()
number of active connections
|
boolean |
isDecommissioned()
Returns true if the node has been decommissioned.
|
boolean |
isDecommissionInProgress()
Returns true if the node is in the process of being decommissioned
|
boolean |
isStale(long staleInterval)
Check if the datanode is in stale state.
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in . |
protected void |
setAdminState(DatanodeInfo.AdminStates newState)
Sets the admin state of this node.
|
void |
setCapacity(long capacity)
Sets raw capacity.
|
void |
setDecommissioned()
Sets the admin state to indicate that decommision is complete.
|
void |
setHostName(String host) |
void |
setLastUpdate(long lastUpdate)
Sets time when this information was accurate.
|
void |
setLevel(int level)
Set this node's level in the tree.
|
void |
setNetworkLocation(String location)
Sets the network location
|
void |
setParent(Node parent)
Set this node's parent
|
void |
setRemaining(long remaining)
Sets raw free space.
|
void |
setXceiverCount(int xceiverCount)
Sets number of active connections
|
void |
startDecommission()
Start decommissioning a node.
|
void |
stopDecommission()
Stop decommissioning a node.
|
void |
write(DataOutput out)
Serialize the fields of this object to
out . |
compareTo, equals, getHost, getInfoPort, getIpcPort, getName, getPort, getStorageID, hashCode, setStorageID, toString, updateRegInfo
protected long capacity
protected long dfsUsed
protected long remaining
protected long lastUpdate
protected int xceiverCount
protected String location
protected String hostName
protected DatanodeInfo.AdminStates adminState
public DatanodeInfo()
public DatanodeInfo(DatanodeInfo from)
public DatanodeInfo(DatanodeID nodeID)
protected DatanodeInfo(DatanodeID nodeID, String location, String hostName)
public DatanodeInfo(String name, String storageID, int infoPort, int ipcPort, long capacity, long dfsUsed, long remaining, long lastUpdate, int xceiverCount, String networkLocation, String hostName, DatanodeInfo.AdminStates adminState)
public long getCapacity()
public long getDfsUsed()
public long getNonDfsUsed()
public float getDfsUsedPercent()
public long getRemaining()
public float getRemainingPercent()
public long getLastUpdate()
public int getXceiverCount()
public void setCapacity(long capacity)
public void setRemaining(long remaining)
public void setLastUpdate(long lastUpdate)
public void setXceiverCount(int xceiverCount)
public String getNetworkLocation()
getNetworkLocation
在接口中 Node
public void setNetworkLocation(String location)
setNetworkLocation
在接口中 Node
public String getHostName()
public void setHostName(String host)
public String getName(boolean useHostname)
public String getNameWithIpcPort(boolean useHostname)
public String getDatanodeReport()
public String dumpDatanode()
public void startDecommission()
public void stopDecommission()
public boolean isDecommissionInProgress()
public boolean isDecommissioned()
public void setDecommissioned()
public boolean isStale(long staleInterval)
DFSConfigKeys#DFS_NAMENODE_STALE_DATANODE_INTERVAL_MILLI_DEFAULT
),
the datanode will be treated as stale node.staleInterval
- the time interval for marking the node as stale. If the last
update time is beyond the given time interval, the node will be
marked as stale.public DatanodeInfo.AdminStates getAdminState()
protected void setAdminState(DatanodeInfo.AdminStates newState)
public int getLevel()
public void setLevel(int level)
Node
public void write(DataOutput out) throws IOException
out
.write
在接口中 Writable
write
在类中 DatanodeID
out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in) throws IOException
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
在接口中 Writable
readFields
在类中 DatanodeID
in
- DataInput
to deseriablize this object from.IOException
Copyright © 2009 The Apache Software Foundation