You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/06/30 17:37:28 UTC

[39/50] [abbrv] git commit: SLIDER-173 When host is specified in ContainerRequest, relaxLocality should be false

SLIDER-173 When host is specified in ContainerRequest, relaxLocality should be false


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

Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it
Commit: 22c9689e648a13f09dda9e78337ebd5afe7f0a47
Parents: 9619c33
Author: tedyu <yu...@gmail.com>
Authored: Wed Jun 25 19:13:07 2014 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Wed Jun 25 19:13:07 2014 -0700

----------------------------------------------------------------------
 .../slider/server/appmaster/state/OutstandingRequest.java      | 2 +-
 .../org/apache/slider/server/appmaster/state/RoleHistory.java  | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/22c9689e/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java
index 7d3e427..45dd9d1 100644
--- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java
@@ -108,7 +108,7 @@ public final class OutstandingRequest {
     if (node != null) {
       hosts = new String[1];
       hosts[0] = node.hostname;
-      relaxLocality = true;
+      relaxLocality = false;
       locationSpecified = true;
       // tell the node it is in play
       node.getOrCreate(roleId);

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/22c9689e/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java
index 68e7693..990d735 100644
--- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java
@@ -29,6 +29,7 @@ import org.apache.slider.core.exceptions.BadConfigException;
 import org.apache.slider.providers.ProviderRole;
 import org.apache.slider.server.avro.RoleHistoryHeader;
 import org.apache.slider.server.avro.RoleHistoryWriter;
+import org.mortbay.log.Log;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -468,12 +469,17 @@ public class RoleHistory {
     NodeInstance nodeInstance = null;
     
     List<NodeInstance> targets = getNodesForRoleId(roleKey);
+    int cnt = targets == null ? 0 : targets.size();
+    Log.info("There're " + cnt + " nodes to consider for " + role.getName());
     while (targets != null && !targets.isEmpty() && nodeInstance == null) {
       NodeInstance head = targets.remove(0);
       if (head.getActiveRoleInstances(roleKey) == 0) {
         nodeInstance = head;
       }
     }
+    if (nodeInstance == null) {
+      Log.debug("No node selected for " + role.getName());
+    }
     return nodeInstance;
   }