HDFS-14119. Improve GreedyPlanner Parameter Logging. Contributed by Beluga Behr.

This commit is contained in:
Giovanni Matteo Fumarola 2018-12-03 12:55:52 -08:00
parent c9a3aa64dc
commit 69489ff2d1
1 changed files with 10 additions and 14 deletions

View File

@ -64,7 +64,7 @@ public class GreedyPlanner implements Planner {
*/
@Override
public NodePlan plan(DiskBalancerDataNode node) throws Exception {
long startTime = Time.monotonicNow();
final long startTime = Time.monotonicNow();
NodePlan plan = new NodePlan(node.getDataNodeName(),
node.getDataNodePort());
LOG.info("Starting plan for Node : {}:{}",
@ -75,12 +75,10 @@ public class GreedyPlanner implements Planner {
}
}
long endTime = Time.monotonicNow();
String message = String
.format("Compute Plan for Node : %s:%d took %d ms ",
node.getDataNodeName(), node.getDataNodePort(),
endTime - startTime);
LOG.info(message);
final long endTime = Time.monotonicNow();
LOG.info("Compute Plan for Node : {}:{} took {} ms",
node.getDataNodeName(), node.getDataNodePort(), endTime - startTime);
return plan;
}
@ -117,13 +115,12 @@ public class GreedyPlanner implements Planner {
applyStep(nextStep, currentSet, lowVolume, highVolume);
if (nextStep != null) {
LOG.debug("Step : {} ", nextStep.toString());
LOG.debug("Step : {} ", nextStep);
plan.addStep(nextStep);
}
}
String message = String
.format("Disk Volume set %s Type : %s plan completed.",
LOG.info("Disk Volume set {} - Type : {} plan completed.",
currentSet.getSetID(),
currentSet.getVolumes().get(0).getStorageType());
@ -131,7 +128,6 @@ public class GreedyPlanner implements Planner {
plan.setNodeUUID(node.getDataNodeUUID());
plan.setTimeStamp(Time.now());
plan.setPort(node.getDataNodePort());
LOG.info(message);
}
/**
@ -207,7 +203,7 @@ public class GreedyPlanner implements Planner {
// Create a new step
nextStep = new MoveStep(highVolume, currentSet.getIdealUsed(), lowVolume,
bytesToMove, currentSet.getSetID());
LOG.debug(nextStep.toString());
LOG.debug("Next Step: {}", nextStep);
}
return nextStep;
}