@InterfaceAudience.Private @InterfaceStability.Evolving public class DatanodeManager extends Object
Modifier and Type | Method and Description |
---|---|
void |
clearPendingQueues()
Clear any actions that are queued up to be sent to the DNs
on their next heartbeats.
|
void |
fetchDatanodes(List<DatanodeDescriptor> live,
List<DatanodeDescriptor> dead,
boolean removeDecommissionNode)
Fetch live and dead datanodes.
|
DatanodeDescriptor |
getDatanode(DatanodeID nodeID)
Get data node by storage ID.
|
DatanodeDescriptor |
getDatanodeByHost(String host) |
DatanodeDescriptor |
getDatanodeByXferAddr(String host,
int xferPort) |
List<DatanodeDescriptor> |
getDatanodeListForReport(HdfsConstants.DatanodeReportType type)
For generating datanode reports
|
HashMap<String,Integer> |
getDatanodesSoftwareVersions() |
DatanodeStatistics |
getDatanodeStatistics() |
List<DatanodeDescriptor> |
getDecommissioningNodes() |
NetworkTopology |
getNetworkTopology() |
int |
getNumDeadDataNodes() |
int |
getNumLiveDataNodes() |
int |
getNumStaleNodes() |
DatanodeCommand[] |
handleHeartbeat(DatanodeRegistration nodeReg,
String blockPoolId,
long capacity,
long dfsUsed,
long remaining,
long blockPoolUsed,
int xceiverCount,
int maxTransfers,
int failedVolumes)
Handle heartbeat from datanodes.
|
void |
markAllDatanodesStale() |
void |
refreshNodes(Configuration conf)
Rereads conf to get hosts and exclude list file names.
|
void |
registerDatanode(DatanodeRegistration nodeReg)
Register the given datanode with the namenode.
|
void |
removeDatanode(DatanodeID node)
Remove a datanode
|
void |
setBalancerBandwidth(long bandwidth)
Tell all datanodes to use a new, non-persistent bandwidth value for
dfs.balance.bandwidthPerSec.
|
boolean |
shouldAvoidStaleDataNodesForWrite()
Whether stale datanodes should be avoided as targets on the write path.
|
void |
sortLocatedBlocks(String targethost,
List<LocatedBlock> locatedblocks)
Sort the located blocks by the distance to the target host.
|
String |
toString() |
public NetworkTopology getNetworkTopology()
public DatanodeStatistics getDatanodeStatistics()
public void sortLocatedBlocks(String targethost, List<LocatedBlock> locatedblocks)
public DatanodeDescriptor getDatanodeByHost(String host)
public DatanodeDescriptor getDatanodeByXferAddr(String host, int xferPort)
public DatanodeDescriptor getDatanode(DatanodeID nodeID) throws UnregisteredNodeException
nodeID
- UnregisteredNodeException
public void removeDatanode(DatanodeID node) throws UnregisteredNodeException
UnregisteredNodeException
public void registerDatanode(DatanodeRegistration nodeReg) throws DisallowedDatanodeException
nodeReg
- the datanode registrationDisallowedDatanodeException
- if the registration request is
denied because the datanode does not match includes/excludespublic void refreshNodes(Configuration conf) throws IOException
IOException
public int getNumLiveDataNodes()
public int getNumDeadDataNodes()
public List<DatanodeDescriptor> getDecommissioningNodes()
public boolean shouldAvoidStaleDataNodesForWrite()
public int getNumStaleNodes()
public void fetchDatanodes(List<DatanodeDescriptor> live, List<DatanodeDescriptor> dead, boolean removeDecommissionNode)
public List<DatanodeDescriptor> getDatanodeListForReport(HdfsConstants.DatanodeReportType type)
public DatanodeCommand[] handleHeartbeat(DatanodeRegistration nodeReg, String blockPoolId, long capacity, long dfsUsed, long remaining, long blockPoolUsed, int xceiverCount, int maxTransfers, int failedVolumes) throws IOException
IOException
public void setBalancerBandwidth(long bandwidth) throws IOException
bandwidth
- Blanacer bandwidth in bytes per second for all datanodes.IOException
public void markAllDatanodesStale()
public void clearPendingQueues()
Copyright © 2013 Apache Software Foundation. All rights reserved.