@InterfaceAudience.Private @InterfaceStability.Evolving public class DatanodeInfo extends DatanodeID implements Node
Modifier and Type | Class and Description |
---|---|
static class |
DatanodeInfo.AdminStates |
Modifier and Type | Field and Description |
---|---|
protected DatanodeInfo.AdminStates |
adminState |
EMPTY_ARRAY
Constructor and Description |
---|
DatanodeInfo(DatanodeID nodeID) |
DatanodeInfo(DatanodeID nodeID,
String location) |
DatanodeInfo(DatanodeID nodeID,
String location,
long capacity,
long dfsUsed,
long remaining,
long blockPoolUsed,
long lastUpdate,
int xceiverCount,
DatanodeInfo.AdminStates adminState) |
DatanodeInfo(DatanodeInfo from) |
DatanodeInfo(String ipAddr,
String hostName,
String storageID,
int xferPort,
int infoPort,
int infoSecurePort,
int ipcPort,
long capacity,
long dfsUsed,
long remaining,
long blockPoolUsed,
long lastUpdate,
int xceiverCount,
String networkLocation,
DatanodeInfo.AdminStates adminState)
Constructor
|
Modifier and Type | Method and Description |
---|---|
String |
dumpDatanode()
A formatted string for printing the status of the DataNode.
|
boolean |
equals(Object obj) |
DatanodeInfo.AdminStates |
getAdminState()
Retrieves the admin state of this node.
|
long |
getBlockPoolUsed()
The used space by the block pool on data node.
|
float |
getBlockPoolUsedPercent()
Used space by the block pool as percentage of present capacity
|
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
|
long |
getLastUpdate()
The time when this information was accurate.
|
int |
getLevel()
Return this node's level in the tree.
|
String |
getName()
Network location name
|
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.
|
String |
getSoftwareVersion() |
int |
getXceiverCount()
number of active connections
|
int |
hashCode() |
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.
|
protected void |
setAdminState(DatanodeInfo.AdminStates newState)
Sets the admin state of this node.
|
void |
setBlockPoolUsed(long bpUsed)
Sets block pool used space
|
void |
setCapacity(long capacity)
Sets raw capacity.
|
void |
setDecommissioned()
Sets the admin state to indicate that decommission is complete.
|
void |
setDfsUsed(long dfsUsed)
Sets the used space for the datanode.
|
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 |
setSoftwareVersion(String softwareVersion) |
void |
setXceiverCount(int xceiverCount)
Sets number of active connections
|
void |
startDecommission()
Start decommissioning a node.
|
void |
stopDecommission()
Stop decommissioning a node.
|
compareTo, getHostName, getInfoAddr, getInfoPort, getInfoSecureAddr, getInfoSecurePort, getIpAddr, getIpcAddr, getIpcPort, getPeerHostName, getStorageID, getXferAddr, getXferAddr, getXferAddrWithHostname, getXferPort, setIpAddr, setPeerHostName, setStorageID, toString, updateRegInfo
protected DatanodeInfo.AdminStates adminState
public DatanodeInfo(DatanodeInfo from)
public DatanodeInfo(DatanodeID nodeID)
public DatanodeInfo(DatanodeID nodeID, String location)
public DatanodeInfo(DatanodeID nodeID, String location, long capacity, long dfsUsed, long remaining, long blockPoolUsed, long lastUpdate, int xceiverCount, DatanodeInfo.AdminStates adminState)
public DatanodeInfo(String ipAddr, String hostName, String storageID, int xferPort, int infoPort, int infoSecurePort, int ipcPort, long capacity, long dfsUsed, long remaining, long blockPoolUsed, long lastUpdate, int xceiverCount, String networkLocation, DatanodeInfo.AdminStates adminState)
public String getName()
public long getCapacity()
public long getDfsUsed()
public long getBlockPoolUsed()
public long getNonDfsUsed()
public float getDfsUsedPercent()
public long getRemaining()
public float getBlockPoolUsedPercent()
public float getRemainingPercent()
public long getLastUpdate()
public int getXceiverCount()
public void setCapacity(long capacity)
public void setDfsUsed(long dfsUsed)
public void setRemaining(long remaining)
public void setBlockPoolUsed(long bpUsed)
public void setLastUpdate(long lastUpdate)
public void setXceiverCount(int xceiverCount)
public String getNetworkLocation()
getNetworkLocation
in interface Node
public void setNetworkLocation(String location)
setNetworkLocation
in interface Node
location
- the locationpublic String getDatanodeReport()
public String dumpDatanode()
public void startDecommission()
public void stopDecommission()
public boolean isDecommissionInProgress()
public boolean isDecommissioned()
public void setDecommissioned()
public DatanodeInfo.AdminStates getAdminState()
public boolean isStale(long staleInterval)
DFSConfigKeys.DFS_NAMENODE_STALE_DATANODE_INTERVAL_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.protected void setAdminState(DatanodeInfo.AdminStates newState)
public Node getParent()
public void setParent(Node parent)
Node
public int getLevel()
public void setLevel(int level)
Node
public int hashCode()
hashCode
in class DatanodeID
public boolean equals(Object obj)
equals
in class DatanodeID
public String getSoftwareVersion()
public void setSoftwareVersion(String softwareVersion)
Copyright © 2013 Apache Software Foundation. All rights reserved.