You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by nz...@apache.org on 2010/08/31 15:23:02 UTC

svn commit: r991183 - in /hadoop/hive/trunk: CHANGES.txt metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java

Author: nzhang
Date: Tue Aug 31 13:23:01 2010
New Revision: 991183

URL: http://svn.apache.org/viewvc?rev=991183&view=rev
Log:
HIVE-1607. Reinstate and deprecate IMetaStoreClient methods removed in HIVE-675 (Carl Steinbach via Ning Zhang)

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
    hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=991183&r1=991182&r2=991183&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Tue Aug 31 13:23:01 2010
@@ -228,6 +228,10 @@ Trunk -  Unreleased
     HIVE-1605. Regression and improvements in handling NULLs in joins
     (Ning Zhang via namit)
 
+    HIVE-1607. Reinstate and deprecate IMetaStoreClient methods removed 
+    in HIVE-675
+    (Carl Steinbach via Ning Zhang)
+
   TESTS
 
     HIVE-1464. improve  test query performance

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java?rev=991183&r1=991182&r2=991183&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java Tue Aug 31 13:23:01 2010
@@ -18,6 +18,8 @@
 
 package org.apache.hadoop.hive.metastore;
 
+import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME;
+
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
@@ -386,6 +388,13 @@ public class HiveMetaStoreClient impleme
     dropTable(dbname, name, true, true);
   }
 
+  /** {@inheritDoc} */
+  @Deprecated
+  public void dropTable(String tableName, boolean deleteData)
+      throws MetaException, UnknownTableException, TException, NoSuchObjectException {
+    dropTable(DEFAULT_DATABASE_NAME, tableName, deleteData, false);
+  }
+
   /**
    * @param dbname
    * @param name
@@ -463,12 +472,7 @@ public class HiveMetaStoreClient impleme
     return result;
   }
 
-  /**
-   * @return the list of databases
-   * @throws MetaException
-   * @throws TException
-   * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_databases()
-   */
+  /** {@inheritDoc} */
   public List<String> getDatabases(String databasePattern)
     throws MetaException {
     try {
@@ -479,12 +483,7 @@ public class HiveMetaStoreClient impleme
     return null;
   }
 
-  /**
-   * @return the list of databases
-   * @throws MetaException
-   * @throws TException
-   * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_all_databases()
-   */
+  /** {@inheritDoc} */
   public List<String> getAllDatabases() throws MetaException {
     try {
       return client.get_all_databases();
@@ -561,6 +560,13 @@ public class HiveMetaStoreClient impleme
     return deepCopy(client.get_table(dbname, name));
   }
 
+  /** {@inheritDoc} */
+  @Deprecated
+  public Table getTable(String tableName) throws MetaException, TException,
+      NoSuchObjectException {
+    return getTable(DEFAULT_DATABASE_NAME, tableName);
+  }
+
   /**
    * @param name
    * @return the type
@@ -573,6 +579,7 @@ public class HiveMetaStoreClient impleme
     return deepCopy(client.get_type(name));
   }
 
+  /** {@inheritDoc} */
   public List<String> getTables(String dbname, String tablePattern) throws MetaException {
     try {
       return client.get_tables(dbname, tablePattern);
@@ -582,6 +589,7 @@ public class HiveMetaStoreClient impleme
     return null;
   }
 
+  /** {@inheritDoc} */
   public List<String> getAllTables(String dbname) throws MetaException {
     try {
       return client.get_all_tables(dbname);
@@ -601,6 +609,13 @@ public class HiveMetaStoreClient impleme
     return true;
   }
 
+  /** {@inheritDoc} */
+  @Deprecated
+  public boolean tableExists(String tableName) throws MetaException,
+      TException, UnknownDBException {
+    return tableExists(DEFAULT_DATABASE_NAME, tableName);
+  }
+
   public List<String> listPartitionNames(String dbName, String tblName,
       short max) throws MetaException, TException {
     return client.get_partition_names(dbName, tblName, max);

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java?rev=991183&r1=991182&r2=991183&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java Tue Aug 31 13:23:01 2010
@@ -44,15 +44,46 @@ public interface IMetaStoreClient {
 
   public void close();
 
+  /**
+   * Get the names of all databases in the MetaStore that match the given pattern.
+   * @param databasePattern
+   * @return List of database names.
+   * @throws MetaException
+   * @throws TException
+   */
   public List<String> getDatabases(String databasePattern)
       throws MetaException, TException;
 
+  /**
+   * Get the names of all databases in the MetaStore.
+   * @return List of database names.
+   * @throws MetaException
+   * @throws TException
+   */
   public List<String> getAllDatabases()
       throws MetaException, TException;
 
+  /**
+   * Get the names of all tables in the specified database that satisfy the supplied
+   * table name pattern.
+   * @param dbName
+   * @param tablePattern
+   * @return List of table names.
+   * @throws MetaException
+   * @throws TException
+   * @throws UnknownDBException
+   */
   public List<String> getTables(String dbName, String tablePattern)
       throws MetaException, TException, UnknownDBException;
 
+  /**
+   * Get the names of all tables in the specified database.
+   * @param dbName
+   * @return List of table names.
+   * @throws MetaException
+   * @throws TException
+   * @throws UnknownDBException
+   */
   public List<String> getAllTables(String dbName)
       throws MetaException, TException, UnknownDBException;
 
@@ -76,17 +107,70 @@ public interface IMetaStoreClient {
       boolean ignoreUknownTab) throws MetaException, TException,
       NoSuchObjectException;
 
+  /**
+   * Drop the table in the DEFAULT database.
+   *
+   * @param tableName
+   *          The table to drop
+   * @param deleteData
+   *          Should we delete the underlying data
+   * @throws MetaException
+   *           Could not drop table properly.
+   * @throws UnknownTableException
+   *           The table wasn't found.
+   * @throws TException
+   *           A thrift communication error occurred
+   * @throws NoSuchObjectException
+   *           The table wasn't found.
+   *
+   * @deprecated As of release 0.6.0 replaced by {@link #dropTable(String, String, boolean, boolean)}.
+   *             This method will be removed in release 0.7.0.
+   */
+  @Deprecated
+  public void dropTable(String tableName, boolean deleteData)
+      throws MetaException, UnknownTableException, TException,
+      NoSuchObjectException;
+
   public void dropTable(String dbname, String tableName)
       throws MetaException, TException, NoSuchObjectException;
 
-  // public void createTable(String tableName, Properties schema) throws
-  // MetaException, UnknownTableException,
-  // TException;
-
   public boolean tableExists(String databaseName, String tableName) throws MetaException,
       TException, UnknownDBException;
 
   /**
+   * Check to see if the specified table exists in the DEFAULT database.
+   * @param tableName
+   * @return TRUE if DEFAULT.tableName exists, FALSE otherwise.
+   * @throws MetaException
+   * @throws TException
+   * @throws UnknownDBException
+   * @deprecated As of release 0.6.0 replaced by {@link #tableExists(String, String)}.
+   *             This method will be removed in release 0.7.0.
+   */
+  @Deprecated
+  public boolean tableExists(String tableName) throws MetaException,
+      TException, UnknownDBException;
+
+  /**
+   * Get a table object from the DEFAULT database.
+   *
+   * @param tableName
+   *          Name of the table to fetch.
+   * @return An object representing the table.
+   * @throws MetaException
+   *           Could not fetch the table
+   * @throws TException
+   *           A thrift communication error occurred
+   * @throws NoSuchObjectException
+   *           In case the table wasn't found.
+   * @deprecated As of release 0.6.0 replaced by {@link #getTable(String, String)}.
+   *             This method will be removed in release 0.7.0.
+   */
+  @Deprecated
+  public Table getTable(String tableName) throws MetaException, TException,
+      NoSuchObjectException;
+
+  /**
    * Get a Database Object
    * @param databaseName  name of the database to fetch
    * @return