You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by cw...@apache.org on 2011/05/11 01:38:46 UTC
svn commit: r1101679 - in /hive/trunk:
common/src/java/org/apache/hadoop/hive/common/classification/
metastore/src/java/org/apache/hadoop/hive/metastore/
Author: cws
Date: Tue May 10 23:38:46 2011
New Revision: 1101679
URL: http://svn.apache.org/viewvc?rev=1101679&view=rev
Log:
HIVE-2148. Add interface classification in Hive (Ashutosh Chauhan via cws)
Added:
hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/
hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceAudience.java (with props)
hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceStability.java (with props)
Modified:
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
Added: hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceAudience.java
URL: http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceAudience.java?rev=1101679&view=auto
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceAudience.java (added)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceAudience.java Tue May 10 23:38:46 2011
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.common.classification;
+
+import java.lang.annotation.Documented;
+
+/**
+ * Annotation to inform users of a package, class or method's intended audience.
+ */
+public class InterfaceAudience {
+ /**
+ * Intended for use by any project or application.
+ */
+ @Documented public @interface Public {};
+
+ /**
+ * Intended only for the project(s) specified in the annotation
+ */
+ @Documented public @interface LimitedPrivate {
+ String[] value();
+ };
+
+ /**
+ * Intended for use only within Hive itself.
+ */
+ @Documented public @interface Private {};
+
+ private InterfaceAudience() {} // Audience can't exist on its own
+}
+
Propchange: hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceAudience.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceStability.java
URL: http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceStability.java?rev=1101679&view=auto
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceStability.java (added)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceStability.java Tue May 10 23:38:46 2011
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.common.classification;
+
+import java.lang.annotation.Documented;
+
+/**
+ * Annotation to inform users of how much to rely on a particular package,
+ * class or method not changing over time.
+ */
+public class InterfaceStability {
+ /**
+ * Can evolve while retaining compatibility for minor release boundaries.;
+ * can break compatibility only at major release (ie. at m.0).
+ */
+ @Documented
+ public @interface Stable {};
+
+ /**
+ * Evolving, but can break compatibility at minor release (i.e. m.x)
+ */
+ @Documented
+ public @interface Evolving {};
+
+ /**
+ * No guarantee is provided as to reliability or stability across any
+ * level of release granularity.
+ */
+ @Documented
+ public @interface Unstable {};
+}
Propchange: hive/trunk/common/src/java/org/apache/hadoop/hive/common/classification/InterfaceStability.java
------------------------------------------------------------------------------
svn:eol-style = native
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=1101679&r1=1101678&r2=1101679&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 Tue May 10 23:38:46 2011
@@ -38,6 +38,8 @@ import org.apache.commons.logging.LogFac
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.common.JavaUtils;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hadoop.hive.common.metrics.Metrics;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
@@ -289,13 +291,16 @@ public class HiveMetaStore extends Thrif
* The catch blocks are used to ensure that the exceptions thrown by the
* <block of code> follow the function definition.
*/
- private static class Command<T> {
+ @InterfaceAudience.LimitedPrivate({"HCATALOG"})
+ @InterfaceStability.Evolving
+ public static class Command<T> {
T run(RawStore ms) throws Exception {
return null;
}
}
-
- private <T> T executeWithRetry(Command<T> cmd) throws Exception {
+ @InterfaceAudience.LimitedPrivate({"HCATALOG"})
+ @InterfaceStability.Evolving
+ public <T> T executeWithRetry(Command<T> cmd) throws Exception {
T ret = null;
boolean gotNewConnectUrl = false;
@@ -351,7 +356,9 @@ public class HiveMetaStore extends Thrif
* @return
* @throws MetaException
*/
- private RawStore getMS(boolean reloadConf) throws MetaException {
+ @InterfaceAudience.LimitedPrivate({"HCATALOG"})
+ @InterfaceStability.Evolving
+ public RawStore getMS(boolean reloadConf) throws MetaException {
RawStore ms = threadLocalMS.get();
if (ms == null) {
LOG.info(addPrefix("Opening raw store with implemenation class:"
Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java?rev=1101679&r1=1101678&r2=1101679&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java Tue May 10 23:38:46 2011
@@ -48,6 +48,8 @@ import org.apache.commons.logging.LogFac
import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.common.FileUtils;
+import org.apache.hadoop.hive.common.classification.InterfaceAudience;
+import org.apache.hadoop.hive.common.classification.InterfaceStability;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.FieldSchema;
@@ -257,7 +259,9 @@ public class ObjectStore implements RawS
return pmf;
}
- private PersistenceManager getPersistenceManager() {
+ @InterfaceAudience.LimitedPrivate({"HCATALOG"})
+ @InterfaceStability.Evolving
+ public PersistenceManager getPersistenceManager() {
return getPMF().getPersistenceManager();
}