按包的顺序类的顺序来吧,因为我不懂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. ajax 留言板

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. deep learning 的java库

    deepLearning4j: https://github.com/deeplearning4j/libnd4j/issues/208                       deepLearn ...

  3. 第二百三十天 how can I 坚持

    上周日去蟒山摘的松子吗?应该是松子吧,裂开了呢.为啥呢.原来博客园可以上传图片,只是上传起来好费劲啊. 今天程哥问给我分的活多不多,我竟然说了句好多,哎.其实很多问题可以用还好来回答,还好,还行,哈哈 ...

  4. 第二百零九天 how can I 坚持

    上班感觉好空虚啊. 今天感觉也没有什么,只是感觉上班的时候闲了一天,下班的时候就来事了. 确实没什么,只是上班的时候突然感觉好失落. 不该胡扯,朱镕基,言必行. 还有中国高铁谈判的新闻,中国确实是个比 ...

  5. Python使用UUID库生成唯一ID(转)

    原文:http://www.cnblogs.com/dkblog/archive/2011/10/10/2205200.html 资料: Python官方Doc:<20.15. uuid — U ...

  6. js闭包测试

    本文的诞生,源自近期打算做的一个关于javascript中的闭包的专题,由于需要解析闭包对垃圾回收的影响,特此针对不同的javascript引擎,做了相关的测试. 为了能从本文中得到需要的知识,看本文 ...

  7. Azure中国版 制作镜像 捕捉镜像

    因为项目需要需要部署多台功能一样的服务器,简单来说是多台nginx服务器.如果按照原始的做法,是新建vm,然后一台台部署相关服务. 现在Azrue已经可以通过捕获镜像的方式创建vm镜像模板,然后按照创 ...

  8. POJ 1410 Intersection(判断线段交和点在矩形内)

    Intersection Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9996   Accepted: 2632 Desc ...

  9. POJ 3304 Segments (直线和线段相交判断)

    Segments Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7739   Accepted: 2316 Descript ...

  10. How Tomcat Works(十八)

    在前面的文章中,如果我们要启动tomcat容器,我们需要使用Bootstrap类来实例化连接器.servlet容器.Wrapper实例和其他组件,然后调用各个对象的set方法将它们关联起来:这种配置应 ...