|
@@ -238,6 +238,7 @@ public class Dispatcher {
|
|
|
private DDatanode proxySource;
|
|
|
private StorageGroup target;
|
|
|
|
|
|
+ @VisibleForTesting
|
|
|
PendingMove(Source source, StorageGroup target) {
|
|
|
this.source = source;
|
|
|
this.target = target;
|
|
@@ -279,6 +280,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) {
|
|
@@ -1355,6 +1357,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)) {
|