Need to learn more about Hadoop, need to look at the internal source code implementation, so you need to import the Hadoop source into eclipse, a simple summary, the following steps:
First make sure that you have installed Git, Maven3, protobuf2.5, and if you don't need to install it beforehand
1. Download Hadoop source code
git clone git://git.apache.org/hadoop-common.git
2. Enter the Hadoop-common directory and create Eclipse project with Maven
MVN install-dskiptests
MVN eclipse:eclipse-ddownloadsources=true-ddownloadjavadocs=true
3. Import Eclipse
Import Hadoop-common
File->import...->choose "Existing Projects into Workspace" Select Hadoop-common-project directory to import with directory
File->import...->choose "Existing Projects into Workspace" Select Hadoop-assemblies directory to import with directory
Import HDFs
File->import...->choose "Existing Projects into Workspace" Select Hadoop-hdfs-project directory to import with directory
Importing MapReduce
File->import...->choose "Existing Projects into Workspace" Select Hadoop-mapreduce-project directory to import with directory
Import yarn
File->import...->choose "Existing Projects into Workspace" Select Hadoop-yarn-project directory to import with directory
OK, all imported successfully, but there are two places to be aware of:
First, if you want to hadoop-common all compile successfully, you need to set the Hadoop-common Target/generate-test-source/java directory to the source folder
Next, you have to add the Tools.jar of the JDK Lib directory to the Classpath.
Once configured, all code is clearly visible