YARN-3592. Fix typos in RMNodeLabelsManager. Contributed by Sunil G.

This commit is contained in:
Devaraj K 2015-05-08 10:54:36 +05:30
parent 66988476d0
commit a28cd02ba0
2 changed files with 7 additions and 5 deletions

View File

@ -342,6 +342,8 @@ Release 2.8.0 - UNRELEASED
YARN-3572. Correct typos in WritingYarnApplications.md. YARN-3572. Correct typos in WritingYarnApplications.md.
(Gabor Liptak via aajisaka) (Gabor Liptak via aajisaka)
YARN-3592. Fix typos in RMNodeLabelsManager. (Sunil G via devaraj)
Release 2.7.1 - UNRELEASED Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -46,11 +46,11 @@ import com.google.common.collect.ImmutableSet;
public class RMNodeLabelsManager extends CommonNodeLabelsManager { public class RMNodeLabelsManager extends CommonNodeLabelsManager {
protected static class Queue { protected static class Queue {
protected Set<String> acccessibleNodeLabels; protected Set<String> accessibleNodeLabels;
protected Resource resource; protected Resource resource;
protected Queue() { protected Queue() {
acccessibleNodeLabels = accessibleNodeLabels =
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>()); Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
resource = Resource.newInstance(0, 0); resource = Resource.newInstance(0, 0);
} }
@ -98,7 +98,7 @@ public class RMNodeLabelsManager extends CommonNodeLabelsManager {
// check if any queue contains this label // check if any queue contains this label
for (Entry<String, Queue> entry : queueCollections.entrySet()) { for (Entry<String, Queue> entry : queueCollections.entrySet()) {
String queueName = entry.getKey(); String queueName = entry.getKey();
Set<String> queueLabels = entry.getValue().acccessibleNodeLabels; Set<String> queueLabels = entry.getValue().accessibleNodeLabels;
if (queueLabels.contains(label)) { if (queueLabels.contains(label)) {
throw new IOException("Cannot remove label=" + label throw new IOException("Cannot remove label=" + label
+ ", because queue=" + queueName + " is using this label. " + ", because queue=" + queueName + " is using this label. "
@ -275,7 +275,7 @@ public class RMNodeLabelsManager extends CommonNodeLabelsManager {
continue; continue;
} }
q.acccessibleNodeLabels.addAll(labels); q.accessibleNodeLabels.addAll(labels);
for (Host host : nodeCollections.values()) { for (Host host : nodeCollections.values()) {
for (Entry<NodeId, Node> nentry : host.nms.entrySet()) { for (Entry<NodeId, Node> nentry : host.nms.entrySet()) {
NodeId nodeId = nentry.getKey(); NodeId nodeId = nentry.getKey();
@ -468,7 +468,7 @@ public class RMNodeLabelsManager extends CommonNodeLabelsManager {
} }
for (String label : nodeLabels) { for (String label : nodeLabels) {
if (q.acccessibleNodeLabels.contains(label)) { if (q.accessibleNodeLabels.contains(label)) {
return true; return true;
} }
} }