FAQ
Author: kevinwilfong
Date: Mon Mar 11 18:43:38 2013
New Revision: 1455282

URL: http://svn.apache.org/r1455282
Log:
HIVE-4045. Modify PreDropPartitionEvent to pass Table parameter. (Li Yang via kevinwilfong)

Modified:
     hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
     hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/events/PreDropPartitionEvent.java
     hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=1455282&r1=1455281&r2=1455282&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Mon Mar 11 18:43:38 2013
@@ -1877,8 +1877,8 @@ public class HiveMetaStore extends Thrif
        try {
          ms.openTransaction();
          part = ms.getPartition(db_name, tbl_name, part_vals);
-
- firePreEvent(new PreDropPartitionEvent(part, this));
+ tbl = get_table(db_name, tbl_name);
+ firePreEvent(new PreDropPartitionEvent(tbl, part, this));

          if (part == null) {
            throw new NoSuchObjectException("Partition doesn't exist. "
@@ -1906,7 +1906,6 @@ public class HiveMetaStore extends Thrif
                  hiveConf.getUser());
            }
          }
- tbl = get_table(db_name, tbl_name);
        } finally {
          if (!success) {
            ms.rollbackTransaction();

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/events/PreDropPartitionEvent.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/events/PreDropPartitionEvent.java?rev=1455282&r1=1455281&r2=1455282&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/events/PreDropPartitionEvent.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/events/PreDropPartitionEvent.java Mon Mar 11 18:43:38 2013
@@ -20,14 +20,24 @@ package org.apache.hadoop.hive.metastore

  import org.apache.hadoop.hive.metastore.HiveMetaStore.HMSHandler;
  import org.apache.hadoop.hive.metastore.api.Partition;
+import org.apache.hadoop.hive.metastore.api.Table;

  public class PreDropPartitionEvent extends PreEventContext {

    private final Partition partition;
+ private final Table table;

    public PreDropPartitionEvent (Partition partition, HMSHandler handler) {
      super (PreEventType.DROP_PARTITION, handler);
      this.partition = partition;
+ this.table = null;
+ }
+
+
+ public PreDropPartitionEvent (Table table, Partition partition, HMSHandler handler) {
+ super (PreEventType.DROP_PARTITION, handler);
+ this.partition = partition;
+ this.table = table;
    }

    /**
@@ -37,4 +47,11 @@ public class PreDropPartitionEvent exten

      return partition;
    }
+
+ /**
+ * @return the table
+ */
+ public Table getTable() {
+ return table;
+ }
  }

Modified: hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java?rev=1455282&r1=1455281&r2=1455282&view=diff
==============================================================================
--- hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java (original)
+++ hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java Mon Mar 11 18:43:38 2013
@@ -331,6 +331,7 @@ public class TestMetaStoreEventListener

      PreDropPartitionEvent preDropPart = (PreDropPartitionEvent)preNotifyList.get(listSize - 1);
      validateDropPartition(part, preDropPart.getPartition());
+ validateTableInDropPartition(tbl, preDropPart.getTable());

      driver.run("drop table " + tblName);
      listSize++;

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedMar 11, '13 at 6:44p
activeMar 11, '13 at 6:44p
posts1
users1
websitehive.apache.org

1 user in discussion

Kevinwilfong: 1 post

People

Translate

site design / logo © 2021 Grokbase