按包的顺序类的顺序来吧,因为我不懂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. js运动 九宫格展开

    <!doctype html> <html> <head> <meta charset = "utf-8"> <title&g ...

  2. dom cookie记录用户名

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  3. XSS攻击及防御(转)

    add by zhj: 略有修改.另外还有一篇文章值得参考,使用 PHP 构建的 Web 应用如何避免 XSS 攻击,总得来说防御XSS的方法是客户端和服务端都 要对输入做检查,如果只有客户端做检查, ...

  4. 二十八个 HTML5 特性与技巧

    1. New Doctype  你还在使用令人讨厌的难记的XHTML文档类型声明吗?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Trans ...

  5. Leetcode237:Delete Node in a Linked List

    Write a function to delete a node (except the tail) in a singly linked list, given only access to th ...

  6. Memcached 实例

    建立Manager类 package com.alisoft.sme.memcached; import java.util.Date; import com.danga.MemCached.MemC ...

  7. 递归遍历树结构顺序显示并且添加到list集合

    /// <summary> /// 给流程排序 by 于連偉 2015/06/15 /// </summary> /// <param name="lstNex ...

  8. HDU3874Necklace(树状数组+离线操作)

    此题的大意思说有一串珠子,每个珠子都有自己的欣赏值value,现在给你一串珠子每个的欣赏值,并给出一些询问,查询某个区间内部总欣赏值是多少,但是有一个约定就是如果这个区间内部有两个珠子的欣赏值是一样的 ...

  9. C# 扩展方法奇思妙用高级篇六:WinForm 控件选择器

    在Web开发中,jQuery提供了功能异常强大的$选择器来帮助我们获取页面上的对象.但在WinForm中,.Net似乎没有这样一个使用起来比较方便的选择器.好在我们有扩展方法,可以很方便的打造一个. ...

  10. WSARecv()

    简述:从一个套接口接收数据. #include <winsock2.h> int WSAAPI WSARecv ( SOCKET s, LPWSABUF lpBuffers, DWORD ...