tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bi...@apache.org
Subject tez git commit: TEZ-2774. addendum to add a preemption periodic log
Date Wed, 16 Sep 2015 19:50:51 GMT
Repository: tez
Updated Branches:
  refs/heads/master 894d5edd4 -> 1a065b9d8


TEZ-2774. addendum to add a preemption periodic log


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/1a065b9d
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/1a065b9d
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/1a065b9d

Branch: refs/heads/master
Commit: 1a065b9d87d84645363d0c65ae021a6a514169a8
Parents: 894d5ed
Author: Bikas Saha <bikas@apache.org>
Authored: Wed Sep 16 12:50:38 2015 -0700
Committer: Bikas Saha <bikas@apache.org>
Committed: Wed Sep 16 12:50:38 2015 -0700

----------------------------------------------------------------------
 .../dag/app/rm/YarnTaskSchedulerService.java    | 24 +++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/1a065b9d/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
index aaa6165..9aa2ef3 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
@@ -1117,6 +1117,14 @@ public class YarnTaskSchedulerService extends TaskScheduler
     return (int) Math.ceil((original * percent)/100.f);
   }
   
+  private String constructPreemptionPeriodicLog(Resource freeResource) {
+    return "Allocated: " + allocatedResources +
+      " Free: " + freeResource +
+      " pendingRequests: " + taskRequests.size() +
+      " delayedContainers: " + delayedContainerManager.delayedContainers.size() +
+      " heartbeats: " + numHeartbeats + " lastPreemptionHeartbeat: " + heartbeatAtLastPreemption;
+  }
+  
   void preemptIfNeeded() {
     if (preemptionPercentage == 0) {
       // turned off
@@ -1127,10 +1135,11 @@ public class YarnTaskSchedulerService extends TaskScheduler
     synchronized (this) {
       Resource freeResources = amRmClient.getAvailableResources();
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Allocated resource memory: " + allocatedResources.getMemory() +
-          " cpu:" + allocatedResources.getVirtualCores() + 
-          " delayedContainers: " + delayedContainerManager.delayedContainers.size() +
-          " heartbeats: " + numHeartbeats + " lastPreemptionHeartbeat: " + heartbeatAtLastPreemption);
+        LOG.debug(constructPreemptionPeriodicLog(freeResources));
+      } else {
+        if (numHeartbeats % 50 == 1) {
+          LOG.info(constructPreemptionPeriodicLog(freeResources));
+        }
       }
       assert freeResources.getMemory() >= 0;
   
@@ -1156,8 +1165,11 @@ public class YarnTaskSchedulerService extends TaskScheduler
       
       if(fitsIn(highestPriRequest.getCapability(), freeResources)) {
         if (LOG.isDebugEnabled()) {
-          LOG.debug("Highest pri request: " + highestPriRequest + " fits in available resources
"
-              + freeResources);
+          LOG.debug(highestPriRequest + " fits in free resources");
+        } else {
+          if (numHeartbeats % 50 == 1) {
+            LOG.info(highestPriRequest + " fits in free resources");
+          }
         }
         return;
       }


Mime
View raw message