You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by sz...@apache.org on 2014/08/13 20:17:50 UTC

svn commit: r1617788 - in /hive/trunk: itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java ql/src/java/org/apache/hadoop/hive/ql/hooks/EnforceReadOnlyTables.java

Author: szehon
Date: Wed Aug 13 18:17:50 2014
New Revision: 1617788

URL: http://svn.apache.org/r1617788
Log:
HIVE-7684 : Avoid validating hook EnforceReadOnlyTable during test driver cleanup. (Venki Korukanti via Szehon)

Modified:
    hive/trunk/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/EnforceReadOnlyTables.java

Modified: hive/trunk/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
URL: http://svn.apache.org/viewvc/hive/trunk/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java?rev=1617788&r1=1617787&r2=1617788&view=diff
==============================================================================
--- hive/trunk/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java (original)
+++ hive/trunk/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java Wed Aug 13 18:17:50 2014
@@ -617,6 +617,9 @@ public class QTestUtil {
     if(!isSessionStateStarted) {
       startSessionState();
     }
+
+    SessionState.get().getConf().setBoolean("hive.test.shutdown.phase", true);
+
     String cleanupCommands = readEntireFileIntoString(new File(cleanupScript));
     LOG.info("Cleanup (" + cleanupScript + "):\n" + cleanupCommands);
     if(cliDriver == null) {
@@ -624,6 +627,8 @@ public class QTestUtil {
     }
     cliDriver.processLine(cleanupCommands);
 
+    SessionState.get().getConf().setBoolean("hive.test.shutdown.phase", false);
+
     // delete any contents in the warehouse dir
     Path p = new Path(testWarehouse);
     FileSystem fs = p.getFileSystem(conf);

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/EnforceReadOnlyTables.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/EnforceReadOnlyTables.java?rev=1617788&r1=1617787&r2=1617788&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/EnforceReadOnlyTables.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/EnforceReadOnlyTables.java Wed Aug 13 18:17:50 2014
@@ -59,7 +59,10 @@ public class EnforceReadOnlyTables imple
   public void run(SessionState sess, Set<ReadEntity> inputs,
       Set<WriteEntity> outputs, UserGroupInformation ugi)
     throws Exception {
-    if (sess.getConf().getBoolean("hive.test.init.phase", false) == true) {
+
+    // Don't enforce during test driver setup or shutdown.
+    if (sess.getConf().getBoolean("hive.test.init.phase", false) ||
+        sess.getConf().getBoolean("hive.test.shutdown.phase", false)) {
       return;
     }
     for (WriteEntity w: outputs) {