@InterfaceAudience.Private @InterfaceStability.Evolving public class DatanodeDescriptor extends DatanodeInfo
Modifier and Type | Class and Description |
---|---|
static class |
DatanodeDescriptor.BlockIterator
Iterates over the list of blocks belonging to the datanode.
|
static class |
DatanodeDescriptor.BlockTargetPair
Block and targets pair
|
class |
DatanodeDescriptor.DecommissioningStatus
Decommissioning status
|
DatanodeInfo.AdminStates
Modifier and Type | Field and Description |
---|---|
DatanodeDescriptor.DecommissioningStatus |
decommissioningStatus |
boolean |
isAlive |
boolean |
needKeyUpdate |
adminState
EMPTY_ARRAY
Constructor and Description |
---|
DatanodeDescriptor(DatanodeID nodeID)
DatanodeDescriptor constructor
|
DatanodeDescriptor(DatanodeID nodeID,
long capacity,
long dfsUsed,
long remaining,
long bpused,
int xceiverCount,
int failedVolumes)
DatanodeDescriptor constructor
|
DatanodeDescriptor(DatanodeID nodeID,
String networkLocation)
DatanodeDescriptor constructor
|
DatanodeDescriptor(DatanodeID nodeID,
String networkLocation,
long capacity,
long dfsUsed,
long remaining,
long bpused,
int xceiverCount,
int failedVolumes)
DatanodeDescriptor constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
addBlock(BlockInfo b)
Add datanode to the block.
|
boolean |
areBlockContentsStale() |
void |
clearBlockQueues() |
String |
dumpDatanode()
A formatted string for printing the status of the DataNode.
|
boolean |
equals(Object obj) |
long |
getBalancerBandwidth() |
Iterator<BlockInfo> |
getBlockIterator() |
int |
getBlocksScheduled() |
protected BlockInfo |
getHead()
Used for testing only
|
Block[] |
getInvalidateBlocks(int maxblocks)
Remove the specified number of blocks to be invalidated
|
BlockInfoUnderConstruction[] |
getLeaseRecoveryCommand(int maxTransfers) |
List<DatanodeDescriptor.BlockTargetPair> |
getReplicationCommand(int maxTransfers) |
int |
getVolumeFailures() |
int |
hashCode() |
void |
incBlocksScheduled()
Increments counter for number of blocks scheduled.
|
boolean |
isDisallowed()
Is the datanode disallowed from communicating with the namenode?
|
void |
markStaleAfterFailover() |
int |
numBlocks() |
void |
receivedBlockReport() |
boolean |
removeBlock(BlockInfo b)
Remove block from the list of blocks belonging to the data-node.
|
BlockInfo |
replaceBlock(BlockInfo oldBlock,
BlockInfo newBlock)
Replace specified old block with a new one in the DataNodeDescriptor.
|
void |
resetBlocks() |
void |
setBalancerBandwidth(long bandwidth) |
void |
setDisallowed(boolean flag)
Set the flag to indicate if this datanode is disallowed from communicating
with the namenode.
|
void |
updateHeartbeat(long capacity,
long dfsUsed,
long remaining,
long blockPoolUsed,
int xceiverCount,
int volFailures)
Updates stats from datanode heartbeat.
|
void |
updateRegInfo(DatanodeID nodeReg)
Update fields when a new registration request comes in.
|
getAdminState, getBlockPoolUsed, getBlockPoolUsedPercent, getCapacity, getDatanodeReport, getDfsUsed, getDfsUsedPercent, getLastUpdate, getLevel, getName, getNetworkLocation, getNonDfsUsed, getParent, getRemaining, getRemainingPercent, getSoftwareVersion, getXceiverCount, isDecommissioned, isDecommissionInProgress, isStale, setAdminState, setBlockPoolUsed, setCapacity, setDecommissioned, setDfsUsed, setLastUpdate, setLevel, setNetworkLocation, setParent, setRemaining, setSoftwareVersion, setXceiverCount, startDecommission, stopDecommission
compareTo, getHostName, getInfoAddr, getInfoPort, getInfoSecureAddr, getInfoSecurePort, getIpAddr, getIpcAddr, getIpcPort, getPeerHostName, getStorageID, getXferAddr, getXferAddr, getXferAddrWithHostname, getXferPort, setIpAddr, setPeerHostName, setStorageID, toString
public DatanodeDescriptor.DecommissioningStatus decommissioningStatus
public boolean isAlive
public boolean needKeyUpdate
public DatanodeDescriptor(DatanodeID nodeID)
nodeID
- id of the data nodepublic DatanodeDescriptor(DatanodeID nodeID, String networkLocation)
nodeID
- id of the data nodenetworkLocation
- location of the data node in networkpublic DatanodeDescriptor(DatanodeID nodeID, long capacity, long dfsUsed, long remaining, long bpused, int xceiverCount, int failedVolumes)
nodeID
- id of the data nodecapacity
- capacity of the data nodedfsUsed
- space used by the data noderemaining
- remaining capacity of the data nodebpused
- space used by the block pool corresponding to this namenodexceiverCount
- # of data transfers at the data nodepublic DatanodeDescriptor(DatanodeID nodeID, String networkLocation, long capacity, long dfsUsed, long remaining, long bpused, int xceiverCount, int failedVolumes)
nodeID
- id of the data nodenetworkLocation
- location of the data node in networkcapacity
- capacity of the data node, including space used by non-dfsdfsUsed
- the used space by dfs datanoderemaining
- remaining capacity of the data nodebpused
- space used by the block pool corresponding to this namenodexceiverCount
- # of data transfers at the data nodepublic boolean addBlock(BlockInfo b)
public boolean removeBlock(BlockInfo b)
protected BlockInfo getHead()
public BlockInfo replaceBlock(BlockInfo oldBlock, BlockInfo newBlock)
oldBlock
- - block to be replacednewBlock
- - a replacement blockpublic void resetBlocks()
public void clearBlockQueues()
public int numBlocks()
public void updateHeartbeat(long capacity, long dfsUsed, long remaining, long blockPoolUsed, int xceiverCount, int volFailures)
public List<DatanodeDescriptor.BlockTargetPair> getReplicationCommand(int maxTransfers)
public BlockInfoUnderConstruction[] getLeaseRecoveryCommand(int maxTransfers)
public Block[] getInvalidateBlocks(int maxblocks)
public int getBlocksScheduled()
public void incBlocksScheduled()
public int hashCode()
hashCode
in class DatanodeInfo
public boolean equals(Object obj)
equals
in class DatanodeInfo
public void setDisallowed(boolean flag)
public boolean isDisallowed()
public int getVolumeFailures()
public void updateRegInfo(DatanodeID nodeReg)
DatanodeID
updateRegInfo
in class DatanodeID
nodeReg
- DatanodeID to update registration for.public long getBalancerBandwidth()
public void setBalancerBandwidth(long bandwidth)
bandwidth
- balancer bandwidth in bytes per second for this datanodepublic boolean areBlockContentsStale()
public void markStaleAfterFailover()
public void receivedBlockReport()
public String dumpDatanode()
DatanodeInfo
dumpDatanode
in class DatanodeInfo
Copyright © 2013 Apache Software Foundation. All rights reserved.