public class BlockPlacementPolicyWithNodeGroup extends BlockPlacementPolicyDefault
BlockPlacementPolicy.NotEnoughReplicasException
clusterMap, considerLoad
限定符和类型 | 方法和说明 |
---|---|
protected int |
addToExcludedNodes(DatanodeDescriptor localMachine,
HashMap<Node,Node> excludedNodes)
Find other nodes in the same nodegroup of localMachine and add them
into excludeNodes as replica should not be duplicated for nodes
within the same nodegroup
|
protected void |
adjustExcludedNodes(HashMap<Node,Node> excludedNodes,
Node chosenNode)
After choosing a node to place replica, adjust excluded nodes accordingly.
|
protected DatanodeDescriptor |
chooseLocalNode(DatanodeDescriptor localMachine,
HashMap<Node,Node> excludedNodes,
long blocksize,
int maxNodesPerRack,
List<DatanodeDescriptor> results,
boolean avoidStaleNodes)
choose local node of localMachine as the target.
|
protected DatanodeDescriptor |
chooseLocalRack(DatanodeDescriptor localMachine,
HashMap<Node,Node> excludedNodes,
long blocksize,
int maxNodesPerRack,
List<DatanodeDescriptor> results,
boolean avoidStaleNodes) |
protected void |
chooseRemoteRack(int numOfReplicas,
DatanodeDescriptor localMachine,
HashMap<Node,Node> excludedNodes,
long blocksize,
int maxReplicasPerRack,
List<DatanodeDescriptor> results,
boolean avoidStaleNodes) |
protected String |
getRack(DatanodeInfo cur)
Get rack string from a data node
|
void |
initialize(Configuration conf,
FSClusterStats stats,
NetworkTopology clusterMap)
Used to setup a BlockPlacementPolicy object.
|
Iterator<DatanodeDescriptor> |
pickupReplicaSet(Collection<DatanodeDescriptor> first,
Collection<DatanodeDescriptor> second)
Pick up replica node set for deleting replica as over-replicated.
|
chooseRandom, chooseRandom, chooseReplicaToDelete, chooseTarget, chooseTarget, chooseTarget, isGoodTarget, verifyBlockPlacement
adjustSetsWithChosenReplica, chooseTarget, getInstance, splitNodesWithRack
public void initialize(Configuration conf, FSClusterStats stats, NetworkTopology clusterMap)
BlockPlacementPolicyDefault
initialize
在类中 BlockPlacementPolicyDefault
conf
- the configuration objectstats
- retrieve cluster status from hereclusterMap
- cluster topologyprotected DatanodeDescriptor chooseLocalNode(DatanodeDescriptor localMachine, HashMap<Node,Node> excludedNodes, long blocksize, int maxNodesPerRack, List<DatanodeDescriptor> results, boolean avoidStaleNodes) throws BlockPlacementPolicy.NotEnoughReplicasException
chooseLocalNode
在类中 BlockPlacementPolicyDefault
BlockPlacementPolicy.NotEnoughReplicasException
protected void adjustExcludedNodes(HashMap<Node,Node> excludedNodes, Node chosenNode)
BlockPlacementPolicyDefault
protected DatanodeDescriptor chooseLocalRack(DatanodeDescriptor localMachine, HashMap<Node,Node> excludedNodes, long blocksize, int maxNodesPerRack, List<DatanodeDescriptor> results, boolean avoidStaleNodes) throws BlockPlacementPolicy.NotEnoughReplicasException
protected void chooseRemoteRack(int numOfReplicas, DatanodeDescriptor localMachine, HashMap<Node,Node> excludedNodes, long blocksize, int maxReplicasPerRack, List<DatanodeDescriptor> results, boolean avoidStaleNodes) throws BlockPlacementPolicy.NotEnoughReplicasException
protected String getRack(DatanodeInfo cur)
BlockPlacementPolicy
getRack
在类中 BlockPlacementPolicy
protected int addToExcludedNodes(DatanodeDescriptor localMachine, HashMap<Node,Node> excludedNodes)
addToExcludedNodes
在类中 BlockPlacementPolicyDefault
public Iterator<DatanodeDescriptor> pickupReplicaSet(Collection<DatanodeDescriptor> first, Collection<DatanodeDescriptor> second)
Copyright © 2009 The Apache Software Foundation