A Hadoop programmer needs to complete three classes.
The map class, the reduce class, and the main class.
The map and reduce classes are naturally done separately for map and reduce. The main class is responsible for setting up the job for these two classes. After completing these three classes, we generate a jar file. Use this jar file to complete the rest of the work.
First, execute Bin/hdfs dfs-put/home/hadoop/test input
Here, it means to put the file/home/hadoop/test file into input. This input is set up well in advance and the instructions are as follows:
Bin/hadoop Fs–mkdir Input
After inserting input, we execute the instruction:
Bin/hadoop Jar/home/hadoop/workspace/test.jar invertedindexer Input Output
/home/hadoop/workspace/test.jar is the address of the previously generated jar file, and input contains the pending file. The output has yet to be examined.
It is important to note that the invertedindexer here is the name of the main class in the three classes written by the programmer.
Hadoop tasted the first Hadoop program