zoukankan      html  css  js  c++  java
  • 源码-hadoop1.1.0-core-org.apache.hadoop.classification


      

    里面放着两个注解类:InterfaceAudience和InterfaceStability。

    InterfaceAudience 类包含三个注解类型,用来被说明被他们注解的类型的潜在的使用范围(audience)。
             @InterfaceAudience.Public: 对所有工程和应用可用
             @InterfaceAudience.LimitedPrivate: 仅限于某些特定工程,如Comomn,HDFS等
             @InterfaceAudience.Private: 仅限于Hadoop

    InterfaceStability 类包含三个注解,用于说明被他们注解的类型的稳定性。
             @InterfaceStability.Stable: 主版本是稳定的,不同主版本间可能不兼容
             @InterfaceStability.Evolving: 不断变化,不同次版本间可能不兼容
             @InterfaceStability.Unstable: 没有任何可靠性和健壮性保证


     1 /**
     2 *注释省略...
     3 **/
     4 package org.apache.hadoop.classification;
     5 
     6 import java.lang.annotation.Documented;
     7 //只引入了JDK的注释包中的Documented接口,即没有其他hadoop类级联
     8 /**
     9  * Annotation to inform users of a package, class or method's intended audience.
    10  */
    11 //这里面也是注解类,用来向用户表明一个包、类或者方法的潜在的使用范围
    12 @InterfaceAudience.Public
    13 @InterfaceStability.Evolving
    14 //自注解(自己起的名字)。第一个注解就用到了这个类中的第一个内部注解。第二个是同包下的第二个类(不解释)。
    15 public class InterfaceAudience {
    16   /**
    17    * Intended for use by any project or application.
    18    */
    19   @Documented public @interface Public {};
    20   //@Doccumented 是元注解(就是注解注解的注解),作用是指示某一类型的注释将通过 javadoc 和类似的默认工具进行文档化。
    21   //这个注解是标识适用任何工程或者应用
    22   /**
    23    * Intended only for the project(s) specified in the annotation.
    24    * For example, "Common", "HDFS", "MapReduce", "ZooKeeper", "HBase".
    25    */
    26   @Documented public @interface LimitedPrivate {
    27     String[] value();
    28   };
    29   //标识适用于某些特殊的工程。比如HDFS、Mapreduce等
    30   //它的值是个字符串数组,表示可以是多个工程
    31   
    32   /**
    33    * Intended for use only within Hadoop itself.
    34    */
    35   @Documented public @interface Private {};
    36 //只适用于hadoop自己
    37   private InterfaceAudience() {} // Audience can't exist on its own
    38 //构造方法,私有的。已有注释
    39 }

    关于元注解和自定义注解 http://www.cnblogs.com/peida/archive/2013/04/24/3036689.html 


     1 package org.apache.hadoop.classification;
     2 
     3 import java.lang.annotation.Documented;
     4 
     5 /**
     6  * Annotation to inform users of how much to rely on a particular package,
     7  * class or method not changing over time.
     8  */
     9  //说明被他们注解的类型的稳定性
    10 @InterfaceAudience.Public
    11 @InterfaceStability.Evolving
    12 public class InterfaceStability {
    13   /**
    14    * Can evolve while retaining compatibility for minor release boundaries.; 
    15    * can break compatibility only at major release (ie. at m.0).
    16    */
    17   @Documented
    18   public @interface Stable {};
    19   //主版本是稳定的,不同主版本间可能不兼容
    20   /**
    21    * Evolving, but can break compatibility at minor release (i.e. m.x)
    22    */
    23   @Documented
    24   public @interface Evolving {};
    25   //不断变化,不同次版本间可能不兼容
    26   /**
    27    * No guarantee is provided as to reliability or stability across any
    28    * level of release granularity.
    29    */
    30   @Documented
    31   public @interface Unstable {};
    32   //没有任何可靠性和健壮性保证
    33 }

    欲为大树,何与草争;心若不动,风又奈何。
  • 相关阅读:
    Python-S9—Day85-ORM项目实战之forms组件以及Modelform补充、跨域请求及应用
    Python-S9——Day84-ORM项目实战之权限、form以及modelform
    拦截导弹简单版
    Disease Manangement 疾病管理
    状压dp
    排列
    位运算笔记
    对拍
    机房vscode使用方法
    区间dp复习 之 tyvj 1198 矩阵连乘
  • 原文地址:https://www.cnblogs.com/admln/p/classification.html
Copyright © 2011-2022 走看看