public class BlockPlacementPolicyWithNodeGroup extends BlockPlacementPolicyDefault
BlockPlacementPolicy.NotEnoughReplicasException
clusterMap, considerLoad, heartbeatInterval, threadLocalBuilder, tolerateHeartbeatMultiplier
Modifier and Type | Method and Description |
---|---|
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, isGoodTarget, verifyBlockPlacement
adjustSetsWithChosenReplica, getInstance, splitNodesWithRack
public void initialize(Configuration conf, FSClusterStats stats, NetworkTopology clusterMap)
BlockPlacementPolicy
initialize
in class 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
in class BlockPlacementPolicyDefault
BlockPlacementPolicy.NotEnoughReplicasException
protected void adjustExcludedNodes(HashMap<Node,Node> excludedNodes, Node chosenNode)
adjustExcludedNodes
in class BlockPlacementPolicyDefault
protected DatanodeDescriptor chooseLocalRack(DatanodeDescriptor localMachine, HashMap<Node,Node> excludedNodes, long blocksize, int maxNodesPerRack, List<DatanodeDescriptor> results, boolean avoidStaleNodes) throws BlockPlacementPolicy.NotEnoughReplicasException
chooseLocalRack
in class BlockPlacementPolicyDefault
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
chooseRemoteRack
in class BlockPlacementPolicyDefault
BlockPlacementPolicy.NotEnoughReplicasException
protected String getRack(DatanodeInfo cur)
BlockPlacementPolicy
getRack
in class BlockPlacementPolicy
protected int addToExcludedNodes(DatanodeDescriptor localMachine, HashMap<Node,Node> excludedNodes)
addToExcludedNodes
in class BlockPlacementPolicyDefault
public Iterator<DatanodeDescriptor> pickupReplicaSet(Collection<DatanodeDescriptor> first, Collection<DatanodeDescriptor> second)
pickupReplicaSet
in class BlockPlacementPolicyDefault
Copyright © 2013 Apache Software Foundation. All rights reserved.