SLIDER-173 Container requests for the same role should utilize different nodes 
- give higher priority to requests with location specified


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/2449f6f3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/2449f6f3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/2449f6f3

Branch: 
refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it
Commit: 2449f6f35bee3220d05f9b386487d44439c9a3cc
Parents: 3fb598f
Author: tedyu <yuzhih...@gmail.com>
Authored: Mon Jun 30 09:43:31 2014 -0700
Committer: tedyu <yuzhih...@gmail.com>
Committed: Mon Jun 30 09:43:31 2014 -0700

----------------------------------------------------------------------
 .../slider/server/appmaster/state/ContainerPriority.java       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/2449f6f3/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java
----------------------------------------------------------------------
diff --git 
a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java
 
b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java
index 56a5af2..369a932 100644
--- 
a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java
+++ 
b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java
@@ -38,11 +38,11 @@ import org.apache.hadoop.yarn.util.Records;
 public final class ContainerPriority {
 
   // bit that represents whether location is specified
-  static final int LOCATION = 1 << 30;
+  static final int NOLOCATION = 1 << 30;
   
   public static int buildPriority(int role,
                                   boolean locationSpecified) {
-    int location = locationSpecified ? LOCATION : 0;
+    int location = locationSpecified ? 0 : NOLOCATION;
     return role | location;
   }
 
@@ -57,7 +57,7 @@ public final class ContainerPriority {
   
   
   public static int extractRole(int priority) {
-    return priority >= LOCATION ? priority^LOCATION : priority;
+    return priority >= NOLOCATION ? priority^NOLOCATION : priority;
   }
 
   /**

Reply via email to