Class GreedyPlanner
java.lang.Object
org.apache.hadoop.hdfs.server.diskbalancer.planner.GreedyPlanner
- All Implemented Interfaces:
Planner
Greedy Planner is a simple planner that computes the largest possible move at
any point of time given a volumeSet.
This is done by choosing the disks with largest amount of data above and below the idealStorage and then a move is scheduled between them.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGreedyPlanner(double threshold, DiskBalancerDataNode node) Constructs a greedy planner. -
Method Summary
Modifier and TypeMethodDescriptionvoidbalanceVolumeSet(DiskBalancerDataNode node, DiskBalancerVolumeSet vSet, NodePlan plan) Computes Steps to make a DiskBalancerVolumeSet Balanced.plan(DiskBalancerDataNode node) Computes a node plan for the given node.
-
Field Details
-
MB
public static final long MB- See Also:
-
GB
public static final long GB- See Also:
-
TB
public static final long TB- See Also:
-
-
Constructor Details
-
GreedyPlanner
Constructs a greedy planner.- Parameters:
threshold- - Disk tolerance that we are ok withnode- - node on which this planner is operating upon
-
-
Method Details
-
plan
Computes a node plan for the given node. -
balanceVolumeSet
public void balanceVolumeSet(DiskBalancerDataNode node, DiskBalancerVolumeSet vSet, NodePlan plan) throws Exception Computes Steps to make a DiskBalancerVolumeSet Balanced.- Parameters:
node-vSet- - DiskBalancerVolumeSetplan- - NodePlan- Throws:
Exception
-