slfan1989 commented on code in PR #5302:
URL: https://github.com/apache/hadoop/pull/5302#discussion_r1073300128
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/NodeToLabelsEntry.java:
##########
@@ -44,6 +44,11 @@ public NodeToLabelsEntry(String nodeId, ArrayList<String>
labels) {
this.labels = labels;
}
+ public NodeToLabelsEntry(String nodeId, Collection<String> labels) {
+ this.nodeId = nodeId;
+ this.labels.addAll(labels);
Review Comment:
This function is the constructor, we don't need to clean up the existing
data.
`NodeToLabelsEntry` originally contained a constructor, we added a new
constructor, the parameter type is `Collection<String>`.
I think we don't need to clean up the existing data, because this method
will only be called when it is created, and the data in the list should be
empty at this time.
NodeToLabelsEntry#Constructor
```
public NodeToLabelsEntry(String nodeId, ArrayList<String> labels) {
this.nodeId = nodeId;
this.labels = labels;
}
public NodeToLabelsEntry(String nodeId, Collection<String> pLabels) {
this.nodeId = nodeId;
this.labels.addAll(pLabels);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]