按包的顺序类的顺序来吧,因为我不懂hadoop类的具体体系和类之间的联系,如果有一定知识积累的可以看下别人写的hadoop源码解读类的书,类似的有 http://pan.baidu.com/s/1i3GGvvZ  。我看的模模糊糊,因为没基础。


这个包下面只有一个类 HadoopVersionAnnotation,它是一个注释类


 /*
* 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.
*/ //apache的软件所有权声明,意思就是说hadoop所有权是属于apache的。在其其他产品中如tomcat中经常可以看到 package org.apache.hadoop; import java.lang.annotation.*;
//只导入了Java的注释包中的类。一是说明它没有级联其他hadoop类,二是说明这个类基本上就是一个注释类了
/**
* A package attribute that captures the version of Hadoop that was compiled.
*/
//意思是这是个包属性类,当hadoop编译的时候捕捉其版本号
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PACKAGE)
//两个注释。恶补了一下后知道第一个是注释后能让JVM实时通过反射得到注释信息。
//第二个就是指定这个注释类的目标,就是用在什么地方,具体可以用在类上、属性上等等,这个是说这个注释类是
//用来注释包的
public @interface HadoopVersionAnnotation {
//@interface是说这个类是个注释类。
/**
* Get the Hadoop version
* @return the version string "0.6.3-dev"
*/
String version();
//得到hadoop的版本号
/**
* Get the username that compiled Hadoop.
*/
String user();
//得到编译这个hadoop类时的所属用户
/**
* Get the date when Hadoop was compiled.
* @return the date in unix 'date' format
*/
String date();
//当hadoop编译的时候得到时间,而且是unix格式的时间
/**
* Get the url for the subversion repository.
*/
String url();
//得到SVN版本库的地址
/**
* Get the subversion revision.
* @return the revision number as a string (eg. "451451")
*/
String revision();
//得到SVN版本库的补丁号
}

可以看来这个注释类作用体现在编译hadoop的时候。

其中JDK注释类的用法我也是恶补了一下才开始的。推荐 http://blog.csdn.net/foamflower/article/details/5946451 ,讲的很清楚。


这个类我翻译了一下另外一种格式,或许能看的更清楚。

 package org.apache.hadoop;

 import java.lang.annotation.*;

 @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PACKAGE)
public class HadoopVersionAnnotation extends java.lang.annotation.Annotation{ private String version; public void setVersion(String version) {
this.version = version;
}
public String getVersion{
return version;
} private String user; public void setUser(String user) {
this.user = user;
}
public String getUser{
return user;
} private String date; public void setDate(String date) {
this.date = date;
}
public String getDate{
return date;
} private String url; public void setUrl(String url) {
this.url = url;
}
public String getUrl{
return url;
} private String revision; public void setRevision(String revision) {
this.revision = revision;
}
public String getRevision{
return revision;
} }

在apihome.cn中因为hadoop版本不同多一个属性:

  

大概是hash之类的,用来校验的吧。不跟踪,继续hadoop1.1.0吧。


这里吐槽一下在apihome.cn中,因为没有搜索框,并且排序都是按首字母排的,很多类分了很多页,找起来很不方便。所以一个比较简单的方法就是直接访问,比如你要查看hadoop的

hadoopVersionAnnotation这个类,就访问 http://www.apihome.cn/api/hadoop/HadoopVersionAnnotation.html 这个地址,就找到了。


还有一个网址想推荐一下,是在读hadoop实战的时候得到的。里面干货不多,但是有几个mapreduce问题并且可以提交答案并验证,类似蓝桥。这对于我这种想找实战环境的hadoop菜鸟来说挺不错的。

http://cloudcomputing.ruc.edu.cn


希望大牛们多吐槽一下,谢谢。


源码-hadoop1.1.0-core-org.apache.hadoop的更多相关文章

  1. 【转】Win 7 下源码运行OpenERP7.0

    原文地址:Win 7 下源码运行OpenERP7.0 安装Python2.7 下载地址:http://www.python.org/getit/注:OpenERP7.0支持的Python版本最高为2. ...

  2. CentOS7源码安装Redis5.0.4非关系型数据库

    源码安装redis-5.0.4 一. 下载redis 1. 需要连接网络 二. 案例(另一种安装方法) [root@localhost ~]# wget http://download.redis.i ...

  3. 源码安装 qemu-2.0.0 及其依赖 glib-2.12.12

    源码安装qemu-2.0.0 下载源代码并解压 http://wiki.qemu-project.org/download/qemu-2.0.0.tar.bz2 .tar.gz 编译及安装: cd q ...

  4. 源码-hadoop1.1.0-core-org.apache.hadoop.classification

    里面放着两个注解类:InterfaceAudience和InterfaceStability. InterfaceAudience 类包含三个注解类型,用来被说明被他们注解的类型的潜在的使用范围(au ...

  5. CentOS下源码安装vsftpd-3.0.0,并设置指定用户访问指定目录(附带完整配置文件)

    1.卸载系统已经存在的ftp服务器 因为是源码安装,所以不能通过rpm -qa的方式查看是否已经安装ftp服务器,可以通过find / | grep vsftp*方式查看系统中存在哪些与vsftpd相 ...

  6. ubuntu16.04下源码安装onos1.0.2

    由于工作需要,下载安装onos1.0.2的版本,大家看需求可以下载安装更高级的版本 参考链接:http://www.sdnlab.com/14650.html 1.系统环境 Ubuntu16.04 L ...

  7. 源码搭建Zabbix4.0.23LTS监控系统

    实验环境 centos 7.5 主机名 IP地址 配置 应用 controlnode 172.16.1.120/24 4核/8G/60G java-1.8.0-openjdk zabbix serve ...

  8. 烂泥:Linux源码包制作RPM包之Apache

    本文由秀依林枫提供友情赞助,首发于烂泥行天下 公司服务器比较多,需要把apache源码包制作成rpm包,然后放到公司内网yum源上进行下载安装.apache的rpm包安装方式比源码安装方式比较快,这能 ...

  9. 解决从源码编译ncurses6.0编译lib_gen.c报错的问题

    直接从官网的源码编译时,会提示报错: gcc -DHAVE_CONFIG_H -I. -I../include -D_GNU_SOURCE -DNDEBUG -O2 --param max-inlin ...

随机推荐

  1. Linux下Python获取IP地址

    <lnmp一键安装包>中需要获取ip地址,有2种情况:如果服务器只有私网地址没有公网地址,这个时候获取的IP(即私网地址)不能用来判断服务器的位置,于是取其网关地址用来判断服务器在国内还是 ...

  2. Terrain & Light & Camera

    [Terrain Engine] 1.When you press F, wherever your mouse is positioned will be moved to the center o ...

  3. int* V.S. int[]

    [int* V.S. int[]] 在C++中,int[]有2种形态,一种是指针形态,即使用方法和int*一样,另一种是符号形态,即只是一个编译期的符号(意味着在runtime期,所定义的int[]根 ...

  4. ubuntu 64位系统下加速Android模拟器

    安装KVM: sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils 在Postfix Configurati ...

  5. Ubuntu下Android编译环境的配置

    从安装操作系统到编译程序结束,过程大致如下. 1. Ubuntu Linux操作系统安装软件包.使用 Ubuntu 14.04 Desktop系统.安装Linux系统到VMWare虚拟机上. 2. 完 ...

  6. HDU 5438 Ponds (DFS,并查集)

    题意:给定一个图,然后让你把边数为1的结点删除,然后求连通块结点数为奇的权值和. 析:这个题要注意,如果删除一些结点后,又形成了新的边数为1的结点,也应该要删除,这是坑,其他的,先用并查集判一下环,然 ...

  7. 队列与DelphiXe新语法

    好久没写代码了,更久没上博客园的博客了,无聊写几行试一下新语法. 1 unit Main; interface uses Winapi.Windows, Winapi.Messages, System ...

  8. OC:copy 与 retain 的区别

    copy与retain的区别: copy是创建一个新对象,retain是创建一个指针,引用对象计数加1.Copy属性表示两个对象内容相同,新的对象retain为1 ,与旧有对象的引用计数无关,旧有对象 ...

  9. Android中全局Application的onCreate多次调用问题

    String processName = OsUtils.getProcessName(this, android.os.Process.myPid()); if (processName != nu ...

  10. 测试HAPROXY的文件分流办法

    测试HAPROXY的文件分流办法 http://blog.chinaunix.net/uid-20553497-id-3054980.html http://blog.sina.com.cn/s/bl ...