-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecute.sh
More file actions
23 lines (19 loc) · 743 Bytes
/
execute.sh
File metadata and controls
23 lines (19 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Do not uncomment these lines to directly execute the script
# Modify the path to fit your need before using this script
#hdfs dfs -rm -r /user/TA/CalculateAverage/Output/
#hadoop jar CalculateAverage.jar calculateAverage.CalculateAverage /user/shared/CalculateAverage/Input /user/TA/CalculateAverage/Output
#hdfs dfs -cat /user/TA/CalculateAverage/Output/part-*
if [[ "$1" == "" ]]; then
iter=3
else
iter=$1
fi
INPUT_FILE=/user/ta/Average_Sort/input
OUTPUT_FILE=Average_Sort/output
TMP_FILE=Average_Sort/output_tmp
JAR=Average_Sort.jar
hdfs dfs -rm -r $TMP_FILE
hdfs dfs -rm -r $OUTPUT_FILE
hadoop jar $JAR average_sort.Average_Sort $INPUT_FILE $TMP_FILE $OUTPUT_FILE $iter
hdfs dfs -getmerge $OUTPUT_FILE average_sort.txt