tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject [03/23] git commit: TEZ-1009. Fixes in log file roll-over (bikas)
Date Fri, 20 Jun 2014 22:35:41 GMT
TEZ-1009. Fixes in log file roll-over (bikas)


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

Branch: refs/heads/branch-0.4.1-incubating
Commit: 958f0a301055a7bab7f98b4d92ffa916ac8cf90f
Parents: f0e8a73
Author: Bikas Saha <bikas@apache.org>
Authored: Tue Apr 1 16:29:20 2014 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Fri Jun 20 15:34:44 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/tez/common/TezUtils.java   |  4 ++++
 .../org/apache/hadoop/mapred/YarnTezDagChild.java   | 16 +++++-----------
 2 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/958f0a30/tez-common/src/main/java/org/apache/tez/common/TezUtils.java
----------------------------------------------------------------------
diff --git a/tez-common/src/main/java/org/apache/tez/common/TezUtils.java b/tez-common/src/main/java/org/apache/tez/common/TezUtils.java
index e1fb5df..b900527 100644
--- a/tez-common/src/main/java/org/apache/tez/common/TezUtils.java
+++ b/tez-common/src/main/java/org/apache/tez/common/TezUtils.java
@@ -285,10 +285,14 @@ public class TezUtils {
     }
 
     if (containerLogDir != null) {
+      PrintStream temp = System.out;
       System.setOut(new PrintStream(new File(containerLogDir, constructLogFileName(
           TezConfiguration.TEZ_CONTAINER_OUT_FILE_NAME, addend))));
+      temp.close();
+      temp = System.err;
       System.setErr(new PrintStream(new File(containerLogDir, constructLogFileName(
           TezConfiguration.TEZ_CONTAINER_ERR_FILE_NAME, addend))));
+      temp.close();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/958f0a30/tez-dag/src/main/java/org/apache/hadoop/mapred/YarnTezDagChild.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/hadoop/mapred/YarnTezDagChild.java b/tez-dag/src/main/java/org/apache/hadoop/mapred/YarnTezDagChild.java
index d68dfad..e4f76f7 100644
--- a/tez-dag/src/main/java/org/apache/hadoop/mapred/YarnTezDagChild.java
+++ b/tez-dag/src/main/java/org/apache/hadoop/mapred/YarnTezDagChild.java
@@ -434,10 +434,11 @@ public class YarnTezDagChild {
     TezVertexID lastVertexId = null;
     EventMetaData currentSourceInfo = null;
     try {
+      String loggerAddend = "";
       while (true) {
         // poll for new task
         if (taskCount > 0) {
-          updateLoggers(null);
+          TezUtils.updateLoggers(loggerAddend);
         }
         boolean isNewGetTask = true;
         long getTaskPollStartTime = System.currentTimeMillis();
@@ -527,8 +528,9 @@ public class YarnTezDagChild {
             }
           }
           lastVertexId = newVertexId;
-          updateLoggers(currentTaskAttemptID);
-
+          TezUtils.updateLoggers(currentTaskAttemptID.toString());
+          loggerAddend = currentTaskAttemptID.toString() + "_post";
+          
           currentTask = createLogicalTask(attemptNumber, taskSpec,
               defaultConf, tezUmbilical, serviceConsumerMetadata);
           
@@ -713,12 +715,4 @@ public class YarnTezDagChild {
     }
   }
 
-  private static void updateLoggers(TezTaskAttemptID tezTaskAttemptID)
-      throws FileNotFoundException {
-    String addend = "";
-    if (tezTaskAttemptID != null) {
-      addend = tezTaskAttemptID.toString();
-    }
-    TezUtils.updateLoggers(addend);
-  }
 }


Mime
View raw message