xianjingfeng commented on code in PR #1969:
URL:
https://github.com/apache/incubator-uniffle/pull/1969#discussion_r1699547068
##########
coordinator/src/main/java/org/apache/uniffle/coordinator/SimpleClusterManager.java:
##########
@@ -270,6 +270,24 @@ private synchronized boolean
putInExcludedNodesFile(List<String> excludedNodes)
return true;
}
+ private synchronized boolean removeExcludedNodesFile(List<String>
excludedNodes)
+ throws IOException {
+ if (hadoopFileSystem == null) {
+ return false;
+ }
+ Path hadoopPath = new Path(excludedNodesPath);
+ // Obtains the existing excluded node.
+ Set<String> alreadyExistExcludedNodes =
+ parseExcludedNodesFile(hadoopFileSystem.open(hadoopPath));
+ List<String> removedAddExcludedNodes =
+ excludedNodes.stream()
+ .filter(node -> !alreadyExistExcludedNodes.contains(node))
+ .collect(Collectors.toList());
+ // Writes to the new excluded node.
+ writeExcludedNodes2File(removedAddExcludedNodes);
Review Comment:
```suggestion
writeExcludedNodes2File(alreadyExistExcludedNodes.removeAll(excludedNodes));
```
--
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]