hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From naganarasimha...@apache.org
Subject hadoop git commit: YARN-6327. Removing queues from CapacitySchedulerQueueManager and ParentQueue should be done with iterator. Contributed by Jonathan Hung.
Date Thu, 17 Aug 2017 05:14:38 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 9de332d50 -> fa3094e43


YARN-6327. Removing queues from CapacitySchedulerQueueManager and ParentQueue should be done
with iterator. Contributed by Jonathan Hung.

(cherry picked from commit 0a3aa40fe7878c939dbf4e6b43466595159ff930)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/fa3094e4
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/fa3094e4
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/fa3094e4

Branch: refs/heads/branch-2
Commit: fa3094e43697dbb7a2dda2b43d8c0c57bbec4b54
Parents: 9de332d
Author: Naganarasimha <naganarasimha_gr@apache.org>
Authored: Wed Mar 15 01:22:25 2017 +0530
Committer: Naganarasimha <naganarasimha_gr@apache.org>
Committed: Thu Aug 17 10:42:00 2017 +0530

----------------------------------------------------------------------
 .../scheduler/capacity/CapacitySchedulerQueueManager.java     | 7 +++++--
 .../resourcemanager/scheduler/capacity/ParentQueue.java       | 6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/fa3094e4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerQueueManager.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerQueueManager.java
index 70b5699..1ceb6fb 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerQueueManager.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerQueueManager.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -351,10 +352,12 @@ public class CapacitySchedulerQueueManager implements SchedulerQueueManager<
         existingQueues.put(queueName, queue);
       }
     }
-    for (Map.Entry<String, CSQueue> e : existingQueues.entrySet()) {
+    for (Iterator<Map.Entry<String, CSQueue>> itr = existingQueues.entrySet()
+        .iterator(); itr.hasNext();) {
+      Map.Entry<String, CSQueue> e = itr.next();
       String queueName = e.getKey();
       if (!newQueues.containsKey(queueName)) {
-        existingQueues.remove(queueName);
+        itr.remove();
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fa3094e4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
index b6907c4..2e48000 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
@@ -343,10 +343,12 @@ public class ParentQueue extends AbstractCSQueue {
       }
 
       // remove the deleted queue in the refreshed xml.
-      for (Map.Entry<String, CSQueue> e : currentChildQueues.entrySet()) {
+      for (Iterator<Map.Entry<String, CSQueue>> itr = currentChildQueues
+          .entrySet().iterator(); itr.hasNext();) {
+        Map.Entry<String, CSQueue> e = itr.next();
         String queueName = e.getKey();
         if (!newChildQueues.containsKey(queueName)) {
-          currentChildQueues.remove(queueName);
+          itr.remove();
         }
       }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message