HDFS-16585.Add @VisibleForTesting in Dispatcher.java (#4337)

Co-authored-by: Ashutosh Gupta <ashugpt@amazon.com>

Reviewed-by: Tao Li <tomscut@apache.org>
Reviewed-by: Ayush Saxena <ayushsaxena@apache.org>
Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
(cherry picked from commit bee538f785)
This commit is contained in:
Ashutosh Gupta 2022-05-26 22:18:15 +01:00 committed by Wei-Chiu Chuang
parent 55ba3a7944
commit d921cc71fd
No known key found for this signature in database
GPG Key ID: B362E1C021854B9D
1 changed files with 3 additions and 0 deletions

View File

@ -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)) {