diff --git a/map-reduce/README.md b/map-reduce/README.md index 61b5e1e..2a67364 100644 --- a/map-reduce/README.md +++ b/map-reduce/README.md @@ -137,3 +137,9 @@ set the variable in `.bashrc` ```shell export PDSH_RCMD_TYPE=ssh ``` + + +```shell +./run_hadoop_mapreduce.sh clean # clean the output +./run_ha +``` \ No newline at end of file diff --git a/map-reduce/run_hadoop_mapreduce.sh b/map-reduce/run_hadoop_mapreduce.sh index 4ea5607..3631f43 100755 --- a/map-reduce/run_hadoop_mapreduce.sh +++ b/map-reduce/run_hadoop_mapreduce.sh @@ -4,11 +4,19 @@ then echo "Need 1 argument; exit;" exit 1 fi -mvn clean -mvn package avg_by_class_output_dir="avg_by_class_output" avg_by_student_output_dir="avg_by_student_output" relation_output_dir="relation_output" + +if [ "$1" = "clean" ] +then + echo "rm output file" + rm -rf "${relation_output_dir}" "${avg_by_class_output_dir}" "${avg_by_student_output_dir}" + exit 0 +fi +mvn clean +mvn package + JAR_PATH="target/map-reduce-1.0-SNAPSHOT.jar" DATA_PREFIX="test_data"