You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by na...@apache.org on 2011/04/19 20:18:21 UTC

svn commit: r1095153 [2/2] - in /hive/trunk: cli/src/java/org/apache/hadoop/hive/cli/ common/src/java/org/apache/hadoop/hive/conf/ conf/ hwi/src/java/org/apache/hadoop/hive/hwi/ ql/src/java/org/apache/hadoop/hive/ql/ ql/src/java/org/apache/hadoop/hive/...

Modified: hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java?rev=1095153&r1=1095152&r2=1095153&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java (original)
+++ hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java Tue Apr 19 18:18:20 2011
@@ -35,6 +35,7 @@ import org.apache.hadoop.hive.conf.HiveC
 import org.apache.hadoop.hive.metastore.HiveMetaStore;
 import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.apache.hadoop.hive.metastore.api.Schema;
+import org.apache.hadoop.hive.ql.CommandNeedRetryException;
 import org.apache.hadoop.hive.ql.Driver;
 import org.apache.hadoop.hive.ql.plan.api.QueryPlan;
 import org.apache.hadoop.hive.ql.processors.CommandProcessor;
@@ -148,6 +149,10 @@ public class HiveServer extends ThriftHi
           if (proc instanceof Driver) {
             isHiveQuery = true;
             driver = (Driver) proc;
+            // In Hive server mode, we are not able to retry in the FetchTask
+            // case, when calling fetch quueries since execute() has returned.
+            // For now, we disable the test attempts.
+            driver.setTryCount(Integer.MAX_VALUE);
             response = driver.run(cmd);
           } else {
             isHiveQuery = false;
@@ -316,6 +321,10 @@ public class HiveServer extends ThriftHi
         // TODO: return null in some other way
         throw new HiveServerException("OK", 0, "");
        // return "";
+      } catch (CommandNeedRetryException e) {
+        HiveServerException ex = new HiveServerException();
+        ex.setMessage(e.getMessage());
+        throw ex;
       } catch (IOException e) {
         HiveServerException ex = new HiveServerException();
         ex.setMessage(e.getMessage());
@@ -405,6 +414,10 @@ public class HiveServer extends ThriftHi
       driver.setMaxRows(numRows);
       try {
         driver.getResults(result);
+      } catch (CommandNeedRetryException e) {
+        HiveServerException ex = new HiveServerException();
+        ex.setMessage(e.getMessage());
+        throw ex;
       } catch (IOException e) {
         HiveServerException ex = new HiveServerException();
         ex.setMessage(e.getMessage());
@@ -439,6 +452,10 @@ public class HiveServer extends ThriftHi
           rows.addAll(result);
           result.clear();
         }
+      } catch (CommandNeedRetryException e) {
+        HiveServerException ex = new HiveServerException();
+        ex.setMessage(e.getMessage());
+        throw ex;
       } catch (IOException e) {
         HiveServerException ex = new HiveServerException();
         ex.setMessage(e.getMessage());