Skip to content

Commit

Permalink
Merge pull request minyk#1 from minyk/master
Browse files Browse the repository at this point in the history
Fix some issues.
  • Loading branch information
Drake YK Min committed May 5, 2015
2 parents aa31fff + a020f3d commit 716a791
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ if (($benchmark_result == 1))
then
total_time=`expr ${end} - ${start}`
total_time_in_hour=$(echo "scale=4;${total_time}/3600" | bc)
scale_factor=$(echo "scale=4;${hssize}/10000000000" | bc)
scale_factor=$(echo "scale=4;${hssize}/1000000000000" | bc)
perf_metric=$(echo "scale=4;${scale_factor}/${total_time_in_hour}" | bc)

echo -e "${green}$sep============${NC}" | tee -a ./result-"${prefix}".log
Expand Down
4 changes: 0 additions & 4 deletions src/main/scala/com/nexr/spark/terasort/TeraInputFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ object TeraInputFormat {
val KEY_LEN = 10
val VALUE_LEN = 90
val RECORD_LEN = KEY_LEN + VALUE_LEN
val NUM_INPUT_FILES = "mapreduce.input.fileinputformat.numinputfiles"
val NUM_PARTITIONS = "mapreduce.terasort.num.partitions"
val SAMPLE_SIZE = "mapreduce.terasort.partitions.sample"
val SPLIT_SLOP = 1.1
var lastContext : JobContext = null
var lastResult : List[InputSplit] = null
implicit val caseInsensitiveOrdering = UnsignedBytes.lexicographicalComparator
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/nexr/spark/terasort/TeraSort.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object TeraSort {
val sc = new SparkContext(conf)

val dataset = sc.newAPIHadoopFile[Array[Byte], Array[Byte], TeraInputFormat](inputFile)
val sorted = dataset.sortByKey()
val sorted = dataset.partitionBy(new TeraSortPartitioner(dataset.partitions.length)).sortByKey()
sorted.saveAsNewAPIHadoopFile[TeraOutputFormat](outputFile)
}
}

0 comments on commit 716a791

Please sign in to comment.