Repository: hive
Updated Branches:
  refs/heads/master 12a33fd0d -> 9efed65a5


http://git-wip-us.apache.org/repos/asf/hive/blob/9efed65a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java
----------------------------------------------------------------------
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java
index afb4f6b..027fb3f 100644
--- 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java
@@ -21,6 +21,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.common.ValidCompactorTxnList;
 import org.apache.hadoop.hive.common.ValidReadTxnList;
 import org.apache.hadoop.hive.common.ValidTxnList;
+import org.apache.hadoop.hive.metastore.TransactionalValidationListener;
 import org.apache.hadoop.hive.metastore.api.GetOpenTxnsInfoResponse;
 import org.apache.hadoop.hive.metastore.api.GetOpenTxnsResponse;
 import org.apache.hadoop.hive.metastore.api.Table;
@@ -129,13 +130,14 @@ public class TxnUtils {
     }
   }
 
-  /** Checks if a table is a valid ACID table.
+  /**
    * Note, users are responsible for using the correct TxnManager. We do not 
look at
    * SessionState.get().getTxnMgr().supportsAcid() here
-   * @param table table
-   * @return true if table is a legit ACID table, false otherwise
+   * Should produce the same result as
+   * {@link 
org.apache.hadoop.hive.ql.io.AcidUtils#isTransactionalTable(org.apache.hadoop.hive.ql.metadata.Table)}
+   * @return true if table is a transactional table, false otherwise
    */
-  public static boolean isAcidTable(Table table) {
+  public static boolean isTransactionalTable(Table table) {
     if (table == null) {
       return false;
     }
@@ -145,6 +147,16 @@ public class TxnUtils {
   }
 
   /**
+   * Should produce the same result as
+   * {@link 
org.apache.hadoop.hive.ql.io.AcidUtils#isAcidTable(org.apache.hadoop.hive.ql.metadata.Table)}
+   */
+  public static boolean isAcidTable(Table table) {
+    return TxnUtils.isTransactionalTable(table) &&
+      
TransactionalValidationListener.DEFAULT_TRANSACTIONAL_PROPERTY.equals(table.getParameters()
+      .get(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES));
+  }
+
+  /**
    * Build a query (or queries if one query is too big but only for the case 
of 'IN' 
    * composite clause. For the case of 'NOT IN' clauses, multiple queries 
change
    * the semantics of the intended query.

Reply via email to