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 Tue, 14 Mar 2017 19:52:53 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 7515e7510 -> 0a3aa40fe


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


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

Branch: refs/heads/trunk
Commit: 0a3aa40fe7878c939dbf4e6b43466595159ff930
Parents: 7515e75
Author: Naganarasimha <naganarasimha_gr@apache.org>
Authored: Wed Mar 15 01:22:25 2017 +0530
Committer: Naganarasimha <naganarasimha_gr@apache.org>
Committed: Wed Mar 15 01:22:25 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/0a3aa40f/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 8cae6c3..76cb5d6 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;
@@ -312,10 +313,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/0a3aa40f/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 6f82fcc..f84b7a4 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
@@ -333,10 +333,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