hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amareshw...@apache.org
Subject hive git commit: Revert "HIVE-13183 : Adds MapredLocalTasks logs in operation log (Rajat Khandelwal, reviwed by Amareshwari)"
Date Sat, 19 Mar 2016 01:38:17 GMT
Repository: hive
Updated Branches:
  refs/heads/master 3468a6661 -> 1621d01f8


Revert "HIVE-13183 : Adds MapredLocalTasks logs in operation log (Rajat Khandelwal, reviwed
by Amareshwari)"

This reverts commit a65917a3b9699a09fb5fe2569785ab1b14c17b0a.


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/1621d01f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/1621d01f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/1621d01f

Branch: refs/heads/master
Commit: 1621d01f8255532f72d53295442c54c63b4fc4f1
Parents: 3468a66
Author: Amareshwari Sriramadasu <amareshwari@apache.org>
Authored: Sat Mar 19 07:07:57 2016 +0530
Committer: Amareshwari Sriramadasu <amareshwari@apache.org>
Committed: Sat Mar 19 07:07:57 2016 +0530

----------------------------------------------------------------------
 .../apache/hive/common/util/StreamPrinter.java    | 18 +++++++-----------
 .../apache/hadoop/hive/ql/exec/TaskRunner.java    |  3 ++-
 .../apache/hadoop/hive/ql/exec/mr/MapRedTask.java |  5 +++--
 .../hadoop/hive/ql/exec/mr/MapredLocalTask.java   |  9 +++------
 .../hadoop/hive/ql/session/OperationLog.java      | 10 +---------
 5 files changed, 16 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/1621d01f/common/src/java/org/apache/hive/common/util/StreamPrinter.java
----------------------------------------------------------------------
diff --git a/common/src/java/org/apache/hive/common/util/StreamPrinter.java b/common/src/java/org/apache/hive/common/util/StreamPrinter.java
index 1517751..72638fd 100644
--- a/common/src/java/org/apache/hive/common/util/StreamPrinter.java
+++ b/common/src/java/org/apache/hive/common/util/StreamPrinter.java
@@ -33,12 +33,12 @@ import org.apache.hadoop.io.IOUtils;
 public class StreamPrinter extends Thread {
   InputStream is;
   String type;
-  PrintStream[] outputStreams;
+  PrintStream os;
 
-  public StreamPrinter(InputStream is, String type, PrintStream... outputStreams) {
+  public StreamPrinter(InputStream is, String type, PrintStream os) {
     this.is = is;
     this.type = type;
-    this.outputStreams = outputStreams;
+    this.os = os;
   }
 
   @Override
@@ -50,22 +50,18 @@ public class StreamPrinter extends Thread {
       String line = null;
       if (type != null) {
         while ((line = br.readLine()) != null) {
-          for (PrintStream os: outputStreams) {
-            os.println(type + ">" + line);
-          }
+          os.println(type + ">" + line);
         }
       } else {
         while ((line = br.readLine()) != null) {
-          for (PrintStream os: outputStreams) {
-            os.println(line);
-          }
+          os.println(line);
         }
       }
       br.close();
-      br = null;
+      br=null;
     } catch (IOException ioe) {
       ioe.printStackTrace();
-    } finally {
+    }finally{
       IOUtils.closeStream(br);
     }
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/1621d01f/ql/src/java/org/apache/hadoop/hive/ql/exec/TaskRunner.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/TaskRunner.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/TaskRunner.java
index 81f6db0..f6fd081 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/TaskRunner.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/TaskRunner.java
@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
  **/
 
 public class TaskRunner extends Thread {
+
   protected Task<? extends Serializable> tsk;
   protected TaskResult result;
   protected SessionState ss;
@@ -102,7 +103,7 @@ public class TaskRunner extends Thread {
       if (tsk.getException() == null) {
         tsk.setException(t);
       }
-      LOG.error("Error in executeTask", t);
+      t.printStackTrace();
     }
     result.setExitVal(exitVal, tsk.getException());
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/1621d01f/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapRedTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapRedTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapRedTask.java
index a42c2e9..310356c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapRedTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapRedTask.java
@@ -301,7 +301,8 @@ public class MapRedTask extends ExecDriver implements Serializable {
 
       return exitVal;
     } catch (Exception e) {
-      LOG.error("Got exception", e);
+      e.printStackTrace();
+      LOG.error("Exception: " + e.getMessage());
       return (1);
     } finally {
       try {
@@ -312,7 +313,7 @@ public class MapRedTask extends ExecDriver implements Serializable {
         }
 
       } catch (Exception e) {
-        LOG.error("Exception: ", e);
+        LOG.error("Exception: " + e.getMessage());
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/1621d01f/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java
index c81b14c..f5500a4 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java
@@ -65,7 +65,6 @@ import org.apache.hadoop.hive.ql.plan.FetchWork;
 import org.apache.hadoop.hive.ql.plan.MapredLocalWork;
 import org.apache.hadoop.hive.ql.plan.OperatorDesc;
 import org.apache.hadoop.hive.ql.plan.api.StageType;
-import org.apache.hadoop.hive.ql.session.OperationLog;
 import org.apache.hadoop.hive.ql.session.SessionState;
 import org.apache.hadoop.hive.ql.session.SessionState.LogHelper;
 import org.apache.hadoop.hive.serde2.ColumnProjectionUtils;
@@ -318,10 +317,8 @@ public class MapredLocalTask extends Task<MapredLocalWork> implements
Serializab
 
       CachingPrintStream errPrintStream = new CachingPrintStream(System.err);
 
-      StreamPrinter outPrinter = new StreamPrinter(executor.getInputStream(), null, System.out,
-        OperationLog.getCurrentOperationLog().getPrintStream());
-      StreamPrinter errPrinter = new StreamPrinter(executor.getErrorStream(), null, errPrintStream,
-        OperationLog.getCurrentOperationLog().getPrintStream());
+      StreamPrinter outPrinter = new StreamPrinter(executor.getInputStream(), null, System.out);
+      StreamPrinter errPrinter = new StreamPrinter(executor.getErrorStream(), null, errPrintStream);
 
       outPrinter.start();
       errPrinter.start();
@@ -343,7 +340,7 @@ public class MapredLocalTask extends Task<MapredLocalWork> implements
Serializab
 
       return exitVal;
     } catch (Exception e) {
-      LOG.error("Exception: ", e);
+      LOG.error("Exception: " + e, e);
       return (1);
     } finally {
       if (secureDoAs != null) {

http://git-wip-us.apache.org/repos/asf/hive/blob/1621d01f/ql/src/java/org/apache/hadoop/hive/ql/session/OperationLog.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/session/OperationLog.java b/ql/src/java/org/apache/hadoop/hive/ql/session/OperationLog.java
index 6d0f14a..2ecdde9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/session/OperationLog.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/session/OperationLog.java
@@ -39,11 +39,7 @@ public class OperationLog {
   private final LogFile logFile;
   private LoggingLevel opLoggingLevel = LoggingLevel.UNKNOWN;
 
-  public PrintStream getPrintStream() {
-    return logFile.getPrintStream();
-  }
-
-  public enum LoggingLevel {
+  public static enum LoggingLevel {
     NONE, EXECUTION, PERFORMANCE, VERBOSE, UNKNOWN
   }
 
@@ -225,9 +221,5 @@ public class OperationLog {
       }
       return logs;
     }
-
-    public PrintStream getPrintStream() {
-      return out;
-    }
   }
 }


Mime
View raw message