按包的顺序类的顺序来吧,因为我不懂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. 第二百零三天 how can I 坚持

    空虚的有点害怕. 日复一日. 今天做了什么?下班看了个搞笑段子. 上班和刘松聊了一下午,东扯西扯的. 下班玩了两局dota. 想租车去出去玩玩,确实没有什么想去的地方了. 莫巧菲. 哎,未来好可怕啊. ...

  2. 【多线程】Java并发编程:Lock(转载)

    原文链接:http://www.cnblogs.com/dolphin0520/p/3923167.html Java并发编程:Lock 在上一篇文章中我们讲到了如何使用关键字synchronized ...

  3. Educational Codeforces Round 5 E. Sum of Remainders (思维题)

    题目链接:http://codeforces.com/problemset/problem/616/E 题意很简单就不说了. 因为n % x = n - n / x * x 所以答案就等于 n * m ...

  4. Linux下用arptables防arp攻击

    Linux下网络层防火墙iptables很强大,链路层也有类似的防火墙arptables,可针对arp地址进行限制,防止ARP网关欺骗攻击,再配合静态绑定MAC和向网关报告正确的本机MAC地址,有效解 ...

  5. java复制File文件操作

    ==========================复制File操作========================= /**  *   * @param newPath要赋值的路径  * @para ...

  6. Objective-C 学习记录4

    字符串的一些方法使用: 1.创建字典的NSString可变字符串,和NSMutableString不可变字符串.都是objective的对象. char *str是字母数组. 2.字符串格式化:str ...

  7. 多线程下载网络歌曲&播放歌曲&并用seekbar调节进度&显示歌曲两边的时间

    这里先给一个处理时间格式的代码: /** * 时间的处理 *  * @param time * @return */ public static String getTimeFromInt(int t ...

  8. UserControl和CustomControl基础【PluraSight】

    UserControl UserControl实际上就是ContentControl,xaml里<UserControl></UserControl>tag之间包含的实际就是后 ...

  9. JDBC Connection

    [ http://shift-alt-ctrl.iteye.com/blog/1967020]   关于JDBC中关于Connection的两个疑问:   1.Connection实例是线程安全的吗? ...

  10. 如何设置box shadow的透明度

    (从已经死了一次又一次终于挂掉的百度空间人工抢救出来的,发表日期2014-04-24) 今天发现使用box-shadow属性,可以很好的给div添加阴影效果,但是添加的效果如果是: -moz-box- ...