[Swift-commit] r7326 - in SwiftApps/Swift-MapRed/mapred_combiner_V4/examples: . sum_and_count

yadunandb at ci.uchicago.edu yadunandb at ci.uchicago.edu
Mon Nov 25 09:51:34 CST 2013


Author: yadunandb
Date: 2013-11-25 09:51:33 -0600 (Mon, 25 Nov 2013)
New Revision: 7326

Added:
   SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/
   SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/map_core.sh
   SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/reduce_core.sh
Log:
Adding an example

Added: SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/map_core.sh
===================================================================
--- SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/map_core.sh	                        (rev 0)
+++ SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/map_core.sh	2013-11-25 15:51:33 UTC (rev 7326)
@@ -0,0 +1,12 @@
+#!/bin/bash
+ARG1=$1;
+LOWERLIMIT=0
+UPPERLIMIT=1000000
+SLICESIZE=10000  # 10^4 records padded to 100B would result in 1MB file
+#Generate $SLICESIZE number of 100B records of format:  RANDOM_NUMBER 1
+shuf -i $LOWERLIMIT-$UPPERLIMIT -n $SLICESIZE | awk '{printf "%-97s %s\n", $0, 1}' > tmp_shuf
+for i in $(seq 1 1 $ARG1)
+do
+    cat tmp_shuf
+done
+rm tmp_shuf


Property changes on: SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/map_core.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/reduce_core.sh
===================================================================
--- SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/reduce_core.sh	                        (rev 0)
+++ SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/reduce_core.sh	2013-11-25 15:51:33 UTC (rev 7326)
@@ -0,0 +1,3 @@
+#!/bin/bash
+awk '{ sum += $1; count += $2 } END { print sum,count }' $*
+


Property changes on: SwiftApps/Swift-MapRed/mapred_combiner_V4/examples/sum_and_count/reduce_core.sh
___________________________________________________________________
Added: svn:executable
   + *




More information about the Swift-commit mailing list