HDFS-10319. Balancer should not try to pair storages with different types.
This commit is contained in:
parent
b8febb774a
commit
e7f1b8fcb3
|
@ -454,8 +454,7 @@ public class Balancer {
|
|||
final C c = candidates.next();
|
||||
if (!c.hasSpaceForScheduling()) {
|
||||
candidates.remove();
|
||||
} else if (matcher.match(dispatcher.getCluster(),
|
||||
g.getDatanodeInfo(), c.getDatanodeInfo())) {
|
||||
} else if (matchStorageGroups(c, g, matcher)) {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
@ -463,6 +462,13 @@ public class Balancer {
|
|||
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 */
|
||||
void resetData(Configuration conf) {
|
||||
this.overUtilized.clear();
|
||||
|
|
Loading…
Reference in New Issue