hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1583479 - in /hive/branches/branch-0.13: cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
Date Mon, 31 Mar 2014 22:36:12 GMT
Author: hashutosh
Date: Mon Mar 31 22:36:11 2014
New Revision: 1583479

URL: http://svn.apache.org/r1583479
Log:
HIVE-6779 : Hive cli may get into inconsistent state when Ctrl-C is hit on hadoop2 (Ashutosh
Chauhan via Jason Dere)

Modified:
    hive/branches/branch-0.13/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
    hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java

Modified: hive/branches/branch-0.13/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java?rev=1583479&r1=1583478&r2=1583479&view=diff
==============================================================================
--- hive/branches/branch-0.13/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java (original)
+++ hive/branches/branch-0.13/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java Mon Mar
31 22:36:11 2014
@@ -400,7 +400,6 @@ public class CliDriver {
           // First, kill any running MR jobs
           HadoopJobExecHelper.killRunningJobs();
           HiveInterruptUtils.interrupt();
-          this.cliThread.interrupt();
         }
       });
     }

Modified: hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java?rev=1583479&r1=1583478&r2=1583479&view=diff
==============================================================================
--- hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java (original)
+++ hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java Mon
Mar 31 22:36:11 2014
@@ -2132,14 +2132,14 @@ public final class Utilities {
    * @return the summary of all the input paths.
    * @throws IOException
    */
-  public static ContentSummary getInputSummary(Context ctx, MapWork work, PathFilter filter)
+  public static ContentSummary getInputSummary(final Context ctx, MapWork work, PathFilter
filter)
       throws IOException {
     PerfLogger perfLogger = PerfLogger.getPerfLogger();
     perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.INPUT_SUMMARY);
 
     long[] summary = {0, 0, 0};
 
-    List<String> pathNeedProcess = new ArrayList<String>();
+    final List<String> pathNeedProcess = new ArrayList<String>();
 
     // Since multiple threads could call this method concurrently, locking
     // this method will avoid number of threads out of control.
@@ -2182,6 +2182,13 @@ public final class Utilities {
       HiveInterruptCallback interrup = HiveInterruptUtils.add(new HiveInterruptCallback()
{
         @Override
         public void interrupt() {
+          for (String path : pathNeedProcess) {
+            try {
+              new Path(path).getFileSystem(ctx.getConf()).close();
+            } catch (IOException ignore) {
+                LOG.debug(ignore);
+            }
+          }
           if (executor != null) {
             executor.shutdownNow();
           }



Mime
View raw message