HDFS-10335 Mover$Processor#chooseTarget() always chooses the first matching target storage group. Contributed by Mingliang Liu
This commit is contained in:
parent
9d4d30243b
commit
4da6f69ca1
@ -478,7 +478,9 @@ boolean chooseTarget(DBlock db, Source source,
|
|||||||
List<StorageType> targetTypes, Matcher matcher) {
|
List<StorageType> targetTypes, Matcher matcher) {
|
||||||
final NetworkTopology cluster = dispatcher.getCluster();
|
final NetworkTopology cluster = dispatcher.getCluster();
|
||||||
for (StorageType t : targetTypes) {
|
for (StorageType t : targetTypes) {
|
||||||
for(StorageGroup target : storages.getTargetStorages(t)) {
|
final List<StorageGroup> targets = storages.getTargetStorages(t);
|
||||||
|
Collections.shuffle(targets);
|
||||||
|
for (StorageGroup target : targets) {
|
||||||
if (matcher.match(cluster, source.getDatanodeInfo(),
|
if (matcher.match(cluster, source.getDatanodeInfo(),
|
||||||
target.getDatanodeInfo())) {
|
target.getDatanodeInfo())) {
|
||||||
final PendingMove pm = source.addPendingMove(db, target);
|
final PendingMove pm = source.addPendingMove(db, target);
|
||||||
|
Loading…
Reference in New Issue
Block a user