12 CodigoNetbeans
12 CodigoNetbeans
12 CodigoNetbeans
https://netbeans.org/downloads/8.0.1/
Java EE
Instalar
File/New Project
Next
Finish
Click en “Libraries”
carpeta:"hadoop-2.8.0/share/hadoop/common"
seleccionar:"hadoop-common-2.8.0.jar"
Open
Add JAR/Folder
carpeta:"hadoop-2.8.0/share/hadoop/mapreduce"
seleccionar:"hadoop-mapreduce-client-core-2.8.0.jar"
seleccionar:"hadoop-mapreduce-client-common-2.8.0.jar"
seleccionar:"hadoop-mapreduce-client-jobclient-2.8.0.jar"
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;
Compilar el programa.
Tendrás el archivo
Copiarlo a c:/
Ejemplo 1
cd/
hadoop dfsadmin -safemode leave
hadoop fs -mkdir /input_dir
hadoop fs -put C:/input_file.txt /input_dir
hadoop fs -ls /input_dir/
hadoop dfs -cat /input_dir/input_file.txt
Ejemplo 2
cd/
hadoop dfsadmin -safemode leave
hadoop fs -mkdir /input_dir
hadoop fs -put C:/shake.txt /input_dir
hadoop fs -ls /input_dir/
hadoop dfs -cat /input_dir/shake.txt