hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject [21/50] [abbrv] hadoop git commit: YARN-4396. Log the trace information on FSAppAttempt#assignContainer (Contributed by Yiqun Li via Daniel Templeton)
Date Wed, 02 Nov 2016 17:39:00 GMT
YARN-4396. Log the trace information on FSAppAttempt#assignContainer (Contributed by Yiqun
Li via Daniel Templeton)


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

Branch: refs/heads/HDFS-10285
Commit: 2528bea67ff80fae597f10e26c5f70d601af9fb1
Parents: cc2c993
Author: Daniel Templeton <templedf@apache.org>
Authored: Mon Oct 31 13:34:25 2016 -0700
Committer: Daniel Templeton <templedf@apache.org>
Committed: Mon Oct 31 13:34:25 2016 -0700

----------------------------------------------------------------------
 .../scheduler/fair/FSAppAttempt.java            | 57 +++++++++++++++++++-
 1 file changed, 56 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2528bea6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.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/fair/FSAppAttempt.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java
index cef4387..11922d9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java
@@ -294,11 +294,27 @@ public class FSAppAttempt extends SchedulerApplicationAttempt
           rackLocalityThreshold;
 
       // Relax locality constraints once we've surpassed threshold.
-      if (getSchedulingOpportunities(schedulerKey) > (numNodes * threshold)) {
+      int schedulingOpportunities = getSchedulingOpportunities(schedulerKey);
+      double thresholdNum = numNodes * threshold;
+      if (schedulingOpportunities > thresholdNum) {
         if (allowed.equals(NodeType.NODE_LOCAL)) {
+          if (LOG.isTraceEnabled()) {
+            LOG.trace("SchedulingOpportunities: " + schedulingOpportunities
+                + ", nodeLocalityThreshold: " + thresholdNum
+                + ", change allowedLocality from NODE_LOCAL to RACK_LOCAL"
+                + ", priority: " + schedulerKey.getPriority()
+                + ", app attempt id: " + this.attemptId);
+          }
           allowedLocalityLevel.put(schedulerKey, NodeType.RACK_LOCAL);
           resetSchedulingOpportunities(schedulerKey);
         } else if (allowed.equals(NodeType.RACK_LOCAL)) {
+          if (LOG.isTraceEnabled()) {
+            LOG.trace("SchedulingOpportunities: " + schedulingOpportunities
+                + ", rackLocalityThreshold: " + thresholdNum
+                + ", change allowedLocality from RACK_LOCAL to OFF_SWITCH"
+                + ", priority: " + schedulerKey.getPriority()
+                + ", app attempt id: " + this.attemptId);
+          }
           allowedLocalityLevel.put(schedulerKey, NodeType.OFF_SWITCH);
           resetSchedulingOpportunities(schedulerKey);
         }
@@ -365,9 +381,23 @@ public class FSAppAttempt extends SchedulerApplicationAttempt
 
       if (waitTime > thresholdTime) {
         if (allowed.equals(NodeType.NODE_LOCAL)) {
+          if (LOG.isTraceEnabled()) {
+            LOG.trace("Waiting time: " + waitTime
+                + " ms, nodeLocalityDelay time: " + nodeLocalityDelayMs + " ms"
+                + ", change allowedLocality from NODE_LOCAL to RACK_LOCAL"
+                + ", priority: " + schedulerKey.getPriority()
+                + ", app attempt id: " + this.attemptId);
+          }
           allowedLocalityLevel.put(schedulerKey, NodeType.RACK_LOCAL);
           resetSchedulingOpportunities(schedulerKey, currentTimeMs);
         } else if (allowed.equals(NodeType.RACK_LOCAL)) {
+          if (LOG.isTraceEnabled()) {
+            LOG.trace("Waiting time: " + waitTime
+                + " ms, nodeLocalityDelay time: " + nodeLocalityDelayMs + " ms"
+                + ", change allowedLocality from RACK_LOCAL to OFF_SWITCH"
+                + ", priority: " + schedulerKey.getPriority()
+                + ", app attempt id: " + this.attemptId);
+          }
           allowedLocalityLevel.put(schedulerKey, NodeType.OFF_SWITCH);
           resetSchedulingOpportunities(schedulerKey, currentTimeMs);
         }
@@ -818,6 +848,12 @@ public class FSAppAttempt extends SchedulerApplicationAttempt
 
         if (rackLocalRequest != null && rackLocalRequest.getNumContainers() != 0
             && localRequest != null && localRequest.getNumContainers() !=
0) {
+          if (LOG.isTraceEnabled()) {
+            LOG.trace("Assign container on " + node.getNodeName()
+                + " node, assignType: NODE_LOCAL" + ", allowedLocality: "
+                + allowedLocality + ", priority: " + schedulerKey.getPriority()
+                + ", app attempt id: " + this.attemptId);
+          }
           return assignContainer(node, localRequest, NodeType.NODE_LOCAL,
               reserved, schedulerKey);
         }
@@ -829,6 +865,12 @@ public class FSAppAttempt extends SchedulerApplicationAttempt
         if (rackLocalRequest != null && rackLocalRequest.getNumContainers() != 0
             && (allowedLocality.equals(NodeType.RACK_LOCAL) || allowedLocality
             .equals(NodeType.OFF_SWITCH))) {
+          if (LOG.isTraceEnabled()) {
+            LOG.trace("Assign container on " + node.getNodeName()
+                + " node, assignType: RACK_LOCAL" + ", allowedLocality: "
+                + allowedLocality + ", priority: " + schedulerKey.getPriority()
+                + ", app attempt id: " + this.attemptId);
+          }
           return assignContainer(node, rackLocalRequest, NodeType.RACK_LOCAL,
               reserved, schedulerKey);
         }
@@ -843,10 +885,23 @@ public class FSAppAttempt extends SchedulerApplicationAttempt
             && offSwitchRequest.getNumContainers() != 0) {
           if (!hasNodeOrRackLocalRequests(schedulerKey) || allowedLocality
               .equals(NodeType.OFF_SWITCH)) {
+            if (LOG.isTraceEnabled()) {
+              LOG.trace("Assign container on " + node.getNodeName()
+                  + " node, assignType: OFF_SWITCH" + ", allowedLocality: "
+                  + allowedLocality + ", priority: " + schedulerKey.getPriority()
+                  + ", app attempt id: " + this.attemptId);
+            }
             return assignContainer(node, offSwitchRequest, NodeType.OFF_SWITCH,
                 reserved, schedulerKey);
           }
         }
+
+        if (LOG.isTraceEnabled()) {
+          LOG.trace("Can't assign container on " + node.getNodeName()
+              + " node, allowedLocality: " + allowedLocality + ", priority: "
+              + schedulerKey.getPriority() + ", app attempt id: "
+              + this.attemptId);
+        }
       }
     } finally {
       writeLock.unlock();


---------------------------------------------------------------------
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