From d921cc71fdd2422fdf9f5417fd622580eb4438a2 Mon Sep 17 00:00:00 2001 From: Ashutosh Gupta Date: Thu, 26 May 2022 22:18:15 +0100 Subject: [PATCH] HDFS-16585.Add @VisibleForTesting in Dispatcher.java (#4337) Co-authored-by: Ashutosh Gupta Reviewed-by: Tao Li Reviewed-by: Ayush Saxena Signed-off-by: Wei-Chiu Chuang (cherry picked from commit bee538f785c012794a2dcf122dc8717b18beb0f0) --- .../org/apache/hadoop/hdfs/server/balancer/Dispatcher.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java index 8be3fb05ca..3937f331e6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java @@ -239,6 +239,7 @@ public class Dispatcher { private DDatanode proxySource; private StorageGroup target; + @VisibleForTesting PendingMove(Source source, StorageGroup target) { this.source = source; this.target = target; @@ -280,6 +281,7 @@ public class Dispatcher { /** * @return true if the given block is good for the tentative move. */ + @VisibleForTesting boolean markMovedIfGoodBlock(DBlock block, StorageType targetStorageType) { synchronized (block) { synchronized (movedBlocks) { @@ -1357,6 +1359,7 @@ public class Dispatcher { * 2. the block does not have a replica/internalBlock on the target; * 3. doing the move does not reduce the number of racks that the block has */ + @VisibleForTesting boolean isGoodBlockCandidate(StorageGroup source, StorageGroup target, StorageType targetStorageType, DBlock block) { if (source.equals(target)) {