Org. apache. hadoop-hadoopVersionAnnotation, org. apache. hadoop

Source: Internet
Author: User

Org. apache. hadoop-hadoopVersionAnnotation, org. apache. hadoop

Follow the order of classes in the package order, because I don't understand the relationship between the specific system of the hadoop class and the class, if you have accumulated some knowledge, you can look at other people's hadoop source code interpretation class book, similar to the http://pan.baidu.com/s/1i3GGvvZ. I am confused, because there is no foundation.

1/* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. see the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. the ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file before t in compliance 8 * with the License. you may ob Tain a copy of the License at 9*10 * http://www.apache.org/licenses/LICENSE-2.011 * 12 * Unless required by applicable law or agreed to in writing, software13 * distributed under the License is distributed on an "as is" BASIS, 14 * without warranties or conditions of any kind, either express or implied.15 * See the License for the specific language governing permissions and16 * limitations under th E License.17 */18 19 // apache Software ownership statement, which means that hadoop ownership belongs to apache. In other products such as tomcat, we often see 20 21 package org. apache. hadoop; 22 23 import java. lang. annotation. *; 24 // only classes in the Java annotation package are imported. First, it indicates that it does not cascade other hadoop classes, the second is that this class is basically A comment class with 25/** 26 * A package attribute that captures the version of Hadoop that was compiled.27 */28 // meaning this is A package attribute Class, when hadoop is compiled, it captures the version 29 @ Retention (RetentionPolicy. RUNTIME) 30 @ Target (ElementType. PACKAGE) 31 // two annotations. After a negative complement, we know that the first one is to make the JVM get comments through reflection in real time. 32 // The second one is to specify the object of the annotation class, that is, where it is used, which can be used on the class and attribute, this is to say that this annotation class is 33 // 34 public @ interface HadoopVersionAnnotation {35 // @ interface is to say that this class is a annotation class. 36/** 37 * Get the Hadoop version38 * @ return the version string "0.6.3-dev" 39 */40 String version (); 41 // obtain hadoop version 42/** 43 * Get the username that compiled Hadoop.44 */45 String user (); 46 // Get the user 47/*** Get the date when hadoop was compiled.49 * @ return the date in unix 'date' format50 */51 String date (); 52 // Get the time when hadoop is compiled, and the time is in unix format 53/** 54 * Get the url for the subversion repository.55 */56 String url (); 57 // obtain the SVN repository address 58/** 59 * Get the subversion revision.60 * @ return the revision number as a string (eg. "451451") 61 */62 String revision (); 63 // obtain the patch number of the SVN repository 64}

It can be seen that this annotation class is used when hadoop is compiled.

The usage of the JDK annotation class also started with a negative complement. Recommended http://blog.csdn.net/foamflower/article/details/5946451, speak very clearly.

I have translated another format for this category and may be able to see more clearly.

 1 package org.apache.hadoop; 2  3 import java.lang.annotation.*; 4  5 @Retention(RetentionPolicy.RUNTIME) 6 @Target(ElementType.PACKAGE) 7 public class HadoopVersionAnnotation extends java.lang.annotation.Annotation{ 8      9     private String version;10     11     public void setVersion(String version) {12         this.version = version;13     }14     public String getVersion{15         return version;16     }17     18     private String user;19     20     public void setUser(String user) {21         this.user = user;22     }23     public String getUser{24         return user;25     }26     27     private String date;28     29     public void setDate(String date) {30         this.date = date;31     }32     public String getDate{33         return date;34     }35     36     private String url;37     38     public void setUrl(String url) {39         this.url = url;40     }41     public String getUrl{42         return url;43     }44     45     private String revision;46     47     public void setRevision(String revision) {48         this.revision = revision;49     }50     public String getRevision{51         return revision;52     }53 54 }

In apihome.cn, The hadoop version has one more attribute:

  

It's probably hash and so on. It's used for verification. Do not trace. Continue hadoop1.1.0.

 

 

In apihome.cn, because there is no search box and sorting is based on the first letter, many classes are divided into many pages, which is inconvenient to find. Therefore, a simple method is to directly access hadoop. For example, you want to view

HadoopVersionAnnotation class, access the http://www.apihome.cn/api/hadoop/HadoopVersionAnnotation.html address, and found.

 

I would like to recommend another website, which was obtained during the hadoop practice. There are not many dry items, but there are several mapreduce questions that can be submitted and verified, similar to the Blue Bridge. This is quite good for hadoop cainiao I want to find a practical environment.

Http://cloudcomputing.ruc.edu.cn

 

I hope you can speak out more. Thank you.

 


Using eclipse to call hadoop in win7, the following problems occur when creating a mapReduce project:

It is estimated that the JRE version for starting Eclipse is too low. Try to change to a later version of JRE.

Where can I download the API jar package of hadoop hdfs? I want to use JAVA for development in Eclipse

Use maven

<Dependency>
<GroupId> org. apache. hadoop </groupId>
<ArtifactId> hadoop-core </artifactId>
<Version> 0.20.205.0 </version>
</Dependency>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.