Author: suresh
Date: Wed Sep 9 00:43:47 2009
New Revision: 812740
URL: http://svn.apache.org/viewvc?rev=812740&view=rev
Log:
HADOOP-5073. Add annotation mechanism for interface classification. Contributed
by Jakob Homan.
Added:
hadoop/common/trunk/src/java/org/apache/hadoop/classification/
hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceAudience.java
hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceStability.java
Modified:
hadoop/common/trunk/CHANGES.txt
Modified: hadoop/common/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=812740&r1=812739&r2=812740&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Wed Sep 9 00:43:47 2009
@@ -184,6 +184,8 @@
HADOOP-6234. Add new option dfs.umaskmode to set umask in configuration
to use octal or symbolic instead of decimal. (Jakob Homan via suresh)
+ HADOOP-5073. Add annotation mechanism for interface classification.
+ (Jakob Homan via suresh)
IMPROVEMENTS
Added:
hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceAudience.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceAudience.java?rev=812740&view=auto
==============================================================================
---
hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceAudience.java
(added)
+++
hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceAudience.java
Wed Sep 9 00:43:47 2009
@@ -0,0 +1,47 @@
+/*
+ * 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.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 {
+ public enum Project {COMMON, AVRO, CHUKWA, HBASE, HDFS,
+ HIVE, MAPREDUCE, PIG, ZOOKEEPER};
+
+ Project[] value();
+ };
+
+ /**
+ * Intended for use only within Hadoop itself.
+ */
+ @Documented public @interface Private {};
+
+ private InterfaceAudience() {} // Audience can't exist on its own
+}
Added:
hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceStability.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceStability.java?rev=812740&view=auto
==============================================================================
---
hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceStability.java
(added)
+++
hadoop/common/trunk/src/java/org/apache/hadoop/classification/InterfaceStability.java
Wed Sep 9 00:43:47 2009
@@ -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.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 {};
+}