HDFS-10319. Balancer should not try to pair storages with different types.
This commit is contained in:
parent
b726ae0876
commit
704c57e3eb
|
@ -520,8 +520,7 @@ public class Balancer {
|
||||||
final C c = candidates.next();
|
final C c = candidates.next();
|
||||||
if (!c.hasSpaceForScheduling()) {
|
if (!c.hasSpaceForScheduling()) {
|
||||||
candidates.remove();
|
candidates.remove();
|
||||||
} else if (matcher.match(dispatcher.getCluster(),
|
} else if (matchStorageGroups(c, g, matcher)) {
|
||||||
g.getDatanodeInfo(), c.getDatanodeInfo())) {
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -529,6 +528,13 @@ public class Balancer {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean matchStorageGroups(StorageGroup left, StorageGroup right,
|
||||||
|
Matcher matcher) {
|
||||||
|
return left.getStorageType() == right.getStorageType()
|
||||||
|
&& matcher.match(dispatcher.getCluster(),
|
||||||
|
left.getDatanodeInfo(), right.getDatanodeInfo());
|
||||||
|
}
|
||||||
|
|
||||||
/* reset all fields in a balancer preparing for the next iteration */
|
/* reset all fields in a balancer preparing for the next iteration */
|
||||||
void resetData(Configuration conf) {
|
void resetData(Configuration conf) {
|
||||||
this.overUtilized.clear();
|
this.overUtilized.clear();
|
||||||
|
|
Loading…
Reference in New Issue