Jing9 commented on code in PR #5203:
URL: https://github.com/apache/hadoop/pull/5203#discussion_r1052583684
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/NameNodeConnector.java:
##########
@@ -161,6 +162,7 @@ public static void checkOtherInstanceRunning(boolean
toCheck) {
private final Path idPath;
private OutputStream out;
private final List<Path> targetPaths;
+ private final MoverMetrics moverMetrics;
Review Comment:
NameNodeConnector will also be used by Balancer, while MoverMetrics is only
used by Mover. So not sure if placing MoverMetrics directly in
NameNodeConnector is a good way from the semantic perspective.
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java:
##########
@@ -160,7 +160,7 @@ Collections.<String> emptySet(), movedWinWidth,
moverThreads, 0,
BlockStoragePolicySuite.ID_BIT_LENGTH];
this.excludedPinnedBlocks = excludedPinnedBlocks;
this.nnc = nnc;
- this.metrics = MoverMetrics.create(this);
Review Comment:
If the main issue if the potential naming conflict caused by multiple mover
instances, can we track the existing MoverMetrics instances and their NNC
mappings at the class level (i.e. through a class static field) to avoid the
duplication?
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java:
##########
@@ -160,7 +160,7 @@ Collections.<String> emptySet(), movedWinWidth,
moverThreads, 0,
BlockStoragePolicySuite.ID_BIT_LENGTH];
this.excludedPinnedBlocks = excludedPinnedBlocks;
this.nnc = nnc;
- this.metrics = MoverMetrics.create(this);
+ this.metrics = nnc.getMoverMetrics();
Review Comment:
We also need to add some UTs to reproduce the issue (without your fix) and
validate the fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]