diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index afc584a..4c622f0 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -34,7 +34,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.EnumSet; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -152,6 +151,8 @@ * Hive Metastore Client. * The public implementation of IMetaStoreClient. Methods not inherited from IMetaStoreClient * are not public and can change. Hence this is marked as unstable. + * For users who require retry mechanism when the connection between metastore and client is + * broken, RetryingMetaStoreClient class should be used. */ @Public @Unstable diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java index 5ce58ee..4296a1e 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java @@ -29,6 +29,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hive.common.classification.InterfaceAudience.Public; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.security.UserGroupInformation; @@ -44,6 +45,7 @@ * each call. * */ +@Public public class RetryingMetaStoreClient implements InvocationHandler { private static final Log LOG = LogFactory.getLog(RetryingMetaStoreClient.class.getName()); @@ -68,11 +70,19 @@ protected RetryingMetaStoreClient(HiveConf hiveConf, HiveMetaHookLoader hookLoad HiveConf.class, HiveMetaHookLoader.class}, new Object[] {hiveConf, hookLoader}); } + public static IMetaStoreClient getProxy(HiveConf hiveConf, HiveMetaHookLoader hookLoader) throws MetaException { + return getProxy(hiveConf, hookLoader, null, HiveMetaStoreClient.class.getName()); + } + public static IMetaStoreClient getProxy(HiveConf hiveConf, HiveMetaHookLoader hookLoader, String mscClassName) throws MetaException { return getProxy(hiveConf, hookLoader, null, mscClassName); } + /** + * This constructor is meant for Hive internal use only. + * Please use getProxy(HiveConf hiveConf, HiveMetaHookLoader hookLoader) for external purpose. + */ public static IMetaStoreClient getProxy(HiveConf hiveConf, HiveMetaHookLoader hookLoader, Map metaCallTimeMap, String mscClassName) throws MetaException {