hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r697285 - in /hadoop/core/trunk: CHANGES.txt src/contrib/hive/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
Date Fri, 19 Sep 2008 23:43:37 GMT
Author: dhruba
Date: Fri Sep 19 16:43:37 2008
New Revision: 697285

URL: http://svn.apache.org/viewvc?rev=697285&view=rev
Log:
HADOOP-4120. Hive interactive shell records the time taken by a 
query.  (Raghotham Murthy via dhruba)


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/contrib/hive/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=697285&r1=697284&r2=697285&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Sep 19 16:43:37 2008
@@ -703,6 +703,9 @@
     HADOOP-3592. Fix a couple of possible file leaks in FileUtil
     (Bill de hOra via rangadi)
 
+    HADOOP-4120. Hive interactive shell records the time taken by a 
+    query.  (Raghotham Murthy via dhruba)
+
 Release 0.18.1 - 2008-09-17
 
   IMPROVEMENTS

Modified: hadoop/core/trunk/src/contrib/hive/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/hive/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java?rev=697285&r1=697284&r2=697285&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/hive/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
(original)
+++ hadoop/core/trunk/src/contrib/hive/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
Fri Sep 19 16:43:37 2008
@@ -28,6 +28,9 @@
 import org.apache.hadoop.hive.ql.exec.Utilities.StreamPrinter;
 import org.apache.hadoop.hive.ql.session.SessionState;
 import org.apache.hadoop.hive.ql.Driver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hive.ql.session.SessionState.LogHelper;
 
 public class CliDriver {
 
@@ -193,8 +196,16 @@
     String historyFile = System.getProperty("user.home") + File.separator  + HISTORYFILE;
     reader.setHistory(new History(new File(historyFile)));
     int ret = 0;
+    Log LOG = LogFactory.getLog("CliDriver");
+    LogHelper console = new LogHelper(LOG);
     while ((line = reader.readLine(prompt+"> ")) != null) {
+      long start = System.currentTimeMillis();
       ret = processLine(line);
+      long end = System.currentTimeMillis();
+      if (end > start) {
+        double timeTaken = (double)(end-start)/1000.0;
+        console.printInfo("Time taken: " + timeTaken + " seconds", null);
+      }
     }
 
     System.exit(ret);



Mime
View raw message