rickyma commented on code in PR #1897:
URL: 
https://github.com/apache/incubator-uniffle/pull/1897#discussion_r1692578798


##########
coordinator/src/main/java/org/apache/uniffle/coordinator/SimpleClusterManager.java:
##########
@@ -179,15 +185,19 @@ public void nodesCheckTest() {
     nodesCheck();
   }
 
-  private void updateExcludeNodes(String path) {
+  private synchronized void updateExcludeNodes(String path) {
     int originalExcludeNodesNumber = excludeNodes.size();
     try {
       Path hadoopPath = new Path(path);
       FileStatus fileStatus = hadoopFileSystem.getFileStatus(hadoopPath);
       if (fileStatus != null && fileStatus.isFile()) {
         long latestModificationTime = fileStatus.getModificationTime();
         if (excludeLastModify.get() != latestModificationTime) {
-          parseExcludeNodesFile(hadoopFileSystem.open(hadoopPath));
+          excludeNodes = 
parseExcludeNodesFile(hadoopFileSystem.open(hadoopPath), true);
+          LOG.info(
+              "Updated exclude nodes and {} nodes were marked as exclude 
nodes",

Review Comment:
   excluded nodes



##########
coordinator/src/main/java/org/apache/uniffle/coordinator/SimpleClusterManager.java:
##########
@@ -205,21 +215,74 @@ private void updateExcludeNodes(String path) {
     CoordinatorMetrics.gaugeExcludeServerNum.set(excludeNodes.size());
   }
 
-  private void parseExcludeNodesFile(DataInputStream fsDataInputStream) throws 
IOException {
+  private Set<String> parseExcludeNodesFile(

Review Comment:
   Please change all the places of "exclude node" or "excludeNode".



##########
coordinator/src/main/java/org/apache/uniffle/coordinator/SimpleClusterManager.java:
##########
@@ -179,15 +184,19 @@ public void nodesCheckTest() {
     nodesCheck();
   }
 
-  private void updateExcludeNodes(String path) {
+  private synchronized void updateExcludeNodes(String path) {

Review Comment:
   This has not be changed yet



##########
coordinator/src/main/java/org/apache/uniffle/coordinator/SimpleClusterManager.java:
##########
@@ -179,15 +185,19 @@ public void nodesCheckTest() {
     nodesCheck();
   }
 
-  private void updateExcludeNodes(String path) {
+  private synchronized void updateExcludeNodes(String path) {
     int originalExcludeNodesNumber = excludeNodes.size();
     try {
       Path hadoopPath = new Path(path);
       FileStatus fileStatus = hadoopFileSystem.getFileStatus(hadoopPath);
       if (fileStatus != null && fileStatus.isFile()) {
         long latestModificationTime = fileStatus.getModificationTime();
         if (excludeLastModify.get() != latestModificationTime) {
-          parseExcludeNodesFile(hadoopFileSystem.open(hadoopPath));
+          excludeNodes = 
parseExcludeNodesFile(hadoopFileSystem.open(hadoopPath), true);

Review Comment:
   excluded



##########
coordinator/src/main/java/org/apache/uniffle/coordinator/SimpleClusterManager.java:
##########
@@ -104,17 +110,17 @@ public SimpleClusterManager(CoordinatorConf conf, 
Configuration hadoopConf) thro
     scheduledExecutorService.scheduleAtFixedRate(
         this::nodesCheck, heartbeatTimeout / 3, heartbeatTimeout / 3, 
TimeUnit.MILLISECONDS);
 
-    String excludeNodesPath =
+    this.excludedNodesPath =
         conf.getString(CoordinatorConf.COORDINATOR_EXCLUDE_NODES_FILE_PATH, 
"");
-    if (!StringUtils.isEmpty(excludeNodesPath)) {
+    if (!StringUtils.isEmpty(excludedNodesPath)) {
       this.hadoopFileSystem =
-          HadoopFilesystemProvider.getFilesystem(new Path(excludeNodesPath), 
hadoopConf);
+          HadoopFilesystemProvider.getFilesystem(new Path(excludedNodesPath), 
hadoopConf);
       long updateNodesInterval =
           
conf.getLong(CoordinatorConf.COORDINATOR_EXCLUDE_NODES_CHECK_INTERVAL);
       checkNodesExecutorService =
           
ThreadUtils.getDaemonSingleThreadScheduledExecutor("UpdateExcludeNodes");

Review Comment:
   UpdateExcludeNodes
   ->
   UpdateExcludedNodes



-- 
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]

Reply via email to