hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [01/29] hadoop git commit: YARN-3941. Proportional Preemption policy should try to avoid sending duplicate PREEMPT_CONTAINER event to scheduler. (Sunil G via wangda)
Date Sat, 25 Jul 2015 17:36:08 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 1e4f36147 -> 8d6dbbb28


YARN-3941. Proportional Preemption policy should try to avoid sending duplicate PREEMPT_CONTAINER
event to scheduler. (Sunil G via wangda)


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

Branch: refs/heads/HADOOP-12111
Commit: 3bba1800513b38a4827f7552f348db87dc47c783
Parents: ee98d63
Author: Wangda Tan <wangda@apache.org>
Authored: Thu Jul 23 10:07:57 2015 -0700
Committer: Wangda Tan <wangda@apache.org>
Committed: Thu Jul 23 10:07:57 2015 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                             | 2 ++
 .../capacity/ProportionalCapacityPreemptionPolicy.java      | 9 ++++++---
 .../capacity/TestProportionalCapacityPreemptionPolicy.java  | 6 +++---
 3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/3bba1800/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 93962f1..9416cd6 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -664,6 +664,8 @@ Release 2.8.0 - UNRELEASED
 
     YARN-3956. Fix TestNodeManagerHardwareUtils fails on Mac (Varun Vasudev via wangda)
 
+    YARN-3941. Proportional Preemption policy should try to avoid sending duplicate PREEMPT_CONTAINER
event to scheduler. (Sunil G via wangda)
+
 Release 2.7.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3bba1800/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/ProportionalCapacityPreemptionPolicy.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/monitor/capacity/ProportionalCapacityPreemptionPolicy.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/ProportionalCapacityPreemptionPolicy.java
index 1152cef..77df059 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/ProportionalCapacityPreemptionPolicy.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/ProportionalCapacityPreemptionPolicy.java
@@ -260,13 +260,16 @@ public class ProportionalCapacityPreemptionPolicy implements SchedulingEditPolic
                   SchedulerEventType.KILL_CONTAINER));
           preempted.remove(container);
         } else {
+          if (preempted.get(container) != null) {
+            // We already updated the information to scheduler earlier, we need
+            // not have to raise another event.
+            continue;
+          }
           //otherwise just send preemption events
           rmContext.getDispatcher().getEventHandler().handle(
               new ContainerPreemptEvent(appAttemptId, container,
                   SchedulerEventType.PREEMPT_CONTAINER));
-          if (preempted.get(container) == null) {
-            preempted.put(container, clock.getTime());
-          }
+          preempted.put(container, clock.getTime());
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3bba1800/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
index bc4d0dc..8d9f48a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
@@ -280,14 +280,14 @@ public class TestProportionalCapacityPreemptionPolicy {
     // requests reiterated
     when(mClock.getTime()).thenReturn(killTime / 2);
     policy.editSchedule();
-    verify(mDisp, times(20)).handle(argThat(new IsPreemptionRequestFor(appC)));
+    verify(mDisp, times(10)).handle(argThat(new IsPreemptionRequestFor(appC)));
 
     // kill req sent
     when(mClock.getTime()).thenReturn(killTime + 1);
     policy.editSchedule();
-    verify(mDisp, times(30)).handle(evtCaptor.capture());
+    verify(mDisp, times(20)).handle(evtCaptor.capture());
     List<ContainerPreemptEvent> events = evtCaptor.getAllValues();
-    for (ContainerPreemptEvent e : events.subList(20, 30)) {
+    for (ContainerPreemptEvent e : events.subList(20, 20)) {
       assertEquals(appC, e.getAppId());
       assertEquals(KILL_CONTAINER, e.getType());
     }


Mime
View raw message