From 5ddc763ab9953eebdaf78af4eb72288d7955b310 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sat, 14 Jun 2014 19:03:21 +0200 Subject: cleanup --- hadoop/streaming/mapper/input | 10 ++++++++ hadoop/streaming/mapper/mapper_test.py | 9 +++++++ hadoop/streaming/mapper/mapper_test.sh | 23 +++++++++++++++++ hadoop/streaming/mapper/mapper_test1.py | 9 +++++++ hadoop/streaming/mapper/mapper_test1.sh | 24 ++++++++++++++++++ hadoop/streaming/mapper_test.input | 10 -------- hadoop/streaming/mapper_test.py | 9 ------- hadoop/streaming/mapper_test.sh | 23 ----------------- hadoop/streaming/mapper_test1.py | 9 ------- hadoop/streaming/mapper_test1.sh | 24 ------------------ hadoop/streaming/no_reducer.input | 8 ------ hadoop/streaming/no_reducer.rb | 9 ------- hadoop/streaming/no_reducer.sh | 23 ----------------- hadoop/streaming/no_reducer/input | 8 ++++++ hadoop/streaming/no_reducer/no_reducer.rb | 9 +++++++ hadoop/streaming/no_reducer/no_reducer.sh | 23 +++++++++++++++++ hadoop/streaming/partitioner/input | 8 ++++++ hadoop/streaming/partitioner/partitioner_test.sh | 22 +++++++++++++++++ hadoop/streaming/partitioner/partitioner_test1.sh | 27 ++++++++++++++++++++ hadoop/streaming/partitioner_test.input | 8 ------ hadoop/streaming/partitioner_test.sh | 22 ----------------- hadoop/streaming/partitioner_test1.sh | 27 -------------------- hadoop/streaming/secondary_sort.input | 8 ------ hadoop/streaming/secondary_sort.sh | 30 ----------------------- hadoop/streaming/secondary_sort/input | 8 ++++++ hadoop/streaming/secondary_sort/secondary_sort.sh | 30 +++++++++++++++++++++++ hadoop/streaming/test.input | 10 -------- hadoop/streaming/test.sh | 23 ----------------- hadoop/streaming/test/input | 10 ++++++++ hadoop/streaming/test/test.sh | 23 +++++++++++++++++ 30 files changed, 243 insertions(+), 243 deletions(-) create mode 100644 hadoop/streaming/mapper/input create mode 100644 hadoop/streaming/mapper/mapper_test.py create mode 100755 hadoop/streaming/mapper/mapper_test.sh create mode 100644 hadoop/streaming/mapper/mapper_test1.py create mode 100755 hadoop/streaming/mapper/mapper_test1.sh delete mode 100644 hadoop/streaming/mapper_test.input delete mode 100644 hadoop/streaming/mapper_test.py delete mode 100755 hadoop/streaming/mapper_test.sh delete mode 100644 hadoop/streaming/mapper_test1.py delete mode 100755 hadoop/streaming/mapper_test1.sh delete mode 100644 hadoop/streaming/no_reducer.input delete mode 100755 hadoop/streaming/no_reducer.rb delete mode 100755 hadoop/streaming/no_reducer.sh create mode 100644 hadoop/streaming/no_reducer/input create mode 100755 hadoop/streaming/no_reducer/no_reducer.rb create mode 100755 hadoop/streaming/no_reducer/no_reducer.sh create mode 100644 hadoop/streaming/partitioner/input create mode 100755 hadoop/streaming/partitioner/partitioner_test.sh create mode 100755 hadoop/streaming/partitioner/partitioner_test1.sh delete mode 100644 hadoop/streaming/partitioner_test.input delete mode 100755 hadoop/streaming/partitioner_test.sh delete mode 100755 hadoop/streaming/partitioner_test1.sh delete mode 100644 hadoop/streaming/secondary_sort.input delete mode 100755 hadoop/streaming/secondary_sort.sh create mode 100644 hadoop/streaming/secondary_sort/input create mode 100755 hadoop/streaming/secondary_sort/secondary_sort.sh delete mode 100644 hadoop/streaming/test.input delete mode 100755 hadoop/streaming/test.sh create mode 100644 hadoop/streaming/test/input create mode 100755 hadoop/streaming/test/test.sh (limited to 'hadoop/streaming') diff --git a/hadoop/streaming/mapper/input b/hadoop/streaming/mapper/input new file mode 100644 index 0000000..338fd87 --- /dev/null +++ b/hadoop/streaming/mapper/input @@ -0,0 +1,10 @@ +0 1 a c +0 2 b c +0 3 c c +1 4 a c +1 5 b c +1 6 c c +1 7 d c +2 8 a c +2 9 b c +2 10 c c diff --git a/hadoop/streaming/mapper/mapper_test.py b/hadoop/streaming/mapper/mapper_test.py new file mode 100644 index 0000000..d358bda --- /dev/null +++ b/hadoop/streaming/mapper/mapper_test.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python2 + +import sys + + +if __name__ == "__main__": + for line in sys.stdin: + print line.upper() + diff --git a/hadoop/streaming/mapper/mapper_test.sh b/hadoop/streaming/mapper/mapper_test.sh new file mode 100755 index 0000000..f0c5da3 --- /dev/null +++ b/hadoop/streaming/mapper/mapper_test.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +hadoop dfs -put input input + +HADOOP_HOME=/usr/lib/hadoop +HADOOP_VERSION=0.20.2-cdh3u1 +JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar +HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" + +OUT=mapper_test_out + +$HSTREAMING \ + -input input \ + -output $OUT \ + -mapper "python mapper.py" \ + -file mapper_test.py \ + -reducer org.apache.hadoop.mapred.lib.IdentityReducer \ + -jobconf mapred.reduce.tasks=3 + +hadoop dfs -get $OUT . +hadoop dfs -rmr $OUT +hadoop dfs -rm input + diff --git a/hadoop/streaming/mapper/mapper_test1.py b/hadoop/streaming/mapper/mapper_test1.py new file mode 100644 index 0000000..79c8aa6 --- /dev/null +++ b/hadoop/streaming/mapper/mapper_test1.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python2 + +import sys + + +if __name__ == "__main__": + for line in sys.stdin: + print "MYKEY\t%s"%line.upper() + diff --git a/hadoop/streaming/mapper/mapper_test1.sh b/hadoop/streaming/mapper/mapper_test1.sh new file mode 100755 index 0000000..475699f --- /dev/null +++ b/hadoop/streaming/mapper/mapper_test1.sh @@ -0,0 +1,24 @@ +#!/bin/sh + + +hadoop dfs -put input input + +HADOOP_HOME=/usr/lib/hadoop +HADOOP_VERSION=0.20.2-cdh3u1 +JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar +HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" + +OUT=mapper_test1_out + +$HSTREAMING \ + -input input \ + -output $OUT \ + -mapper "python mapper1.py" \ + -file mapper_test1.py \ + -reducer org.apache.hadoop.mapred.lib.IdentityReducer \ + -jobconf mapred.reduce.tasks=3 + +hadoop dfs -get $OUT . +hadoop dfs -rmr $OUT +hadoop dfs -rm input + diff --git a/hadoop/streaming/mapper_test.input b/hadoop/streaming/mapper_test.input deleted file mode 100644 index 338fd87..0000000 --- a/hadoop/streaming/mapper_test.input +++ /dev/null @@ -1,10 +0,0 @@ -0 1 a c -0 2 b c -0 3 c c -1 4 a c -1 5 b c -1 6 c c -1 7 d c -2 8 a c -2 9 b c -2 10 c c diff --git a/hadoop/streaming/mapper_test.py b/hadoop/streaming/mapper_test.py deleted file mode 100644 index d358bda..0000000 --- a/hadoop/streaming/mapper_test.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python2 - -import sys - - -if __name__ == "__main__": - for line in sys.stdin: - print line.upper() - diff --git a/hadoop/streaming/mapper_test.sh b/hadoop/streaming/mapper_test.sh deleted file mode 100755 index 4f6e013..0000000 --- a/hadoop/streaming/mapper_test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -hadoop dfs -put mapper_test.input mapper_test.input - -HADOOP_HOME=/usr/lib/hadoop -HADOOP_VERSION=0.20.2-cdh3u1 -JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar -HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" - -OUT=mapper_test_out - -$HSTREAMING \ - -input mapper_test.input \ - -output $OUT \ - -mapper "python mapper.py" \ - -file mapper_test.py \ - -reducer org.apache.hadoop.mapred.lib.IdentityReducer \ - -jobconf mapred.reduce.tasks=3 - -hadoop dfs -get $OUT . -hadoop dfs -rmr $OUT -hadoop dfs -rm mapper_test.input - diff --git a/hadoop/streaming/mapper_test1.py b/hadoop/streaming/mapper_test1.py deleted file mode 100644 index 79c8aa6..0000000 --- a/hadoop/streaming/mapper_test1.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python2 - -import sys - - -if __name__ == "__main__": - for line in sys.stdin: - print "MYKEY\t%s"%line.upper() - diff --git a/hadoop/streaming/mapper_test1.sh b/hadoop/streaming/mapper_test1.sh deleted file mode 100755 index 80611dc..0000000 --- a/hadoop/streaming/mapper_test1.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - - -hadoop dfs -put mapper_test.input mapper_test.input - -HADOOP_HOME=/usr/lib/hadoop -HADOOP_VERSION=0.20.2-cdh3u1 -JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar -HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" - -OUT=mapper_test_out - -$HSTREAMING \ - -input mapper_test.input \ - -output $OUT \ - -mapper "python mapper1.py" \ - -file mapper_test1.py \ - -reducer org.apache.hadoop.mapred.lib.IdentityReducer \ - -jobconf mapred.reduce.tasks=3 - -hadoop dfs -get $OUT . -hadoop dfs -rmr $OUT -hadoop dfs -rm mapper_test.input - diff --git a/hadoop/streaming/no_reducer.input b/hadoop/streaming/no_reducer.input deleted file mode 100644 index 71ac1b5..0000000 --- a/hadoop/streaming/no_reducer.input +++ /dev/null @@ -1,8 +0,0 @@ -a -b -c -d -e -f -g -h diff --git a/hadoop/streaming/no_reducer.rb b/hadoop/streaming/no_reducer.rb deleted file mode 100755 index 4410b93..0000000 --- a/hadoop/streaming/no_reducer.rb +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env ruby - - -i = 0 -while l = STDIN.gets - puts "line #{i} (#{l.strip})" - i+=1 -end - diff --git a/hadoop/streaming/no_reducer.sh b/hadoop/streaming/no_reducer.sh deleted file mode 100755 index 7267166..0000000 --- a/hadoop/streaming/no_reducer.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - - -hadoop dfs -put no_reducer.input no_reducer.input - -HADOOP_HOME=/usr/lib/hadoop -HADOOP_VERSION=0.20.2-cdh3u1 -JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar -HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" - -OUT=no_reducer_out - -$HSTREAMING \ - -input no_reducer.input \ - -output $OUT \ - -mapper "no_reducer.rb" \ - -file "no_reducer.rb" \ - -reducer NONE - -hadoop dfs -get $OUT . -hadoop dfs -rmr $OUT -hadoop dfs -rm no_reducer.input - diff --git a/hadoop/streaming/no_reducer/input b/hadoop/streaming/no_reducer/input new file mode 100644 index 0000000..71ac1b5 --- /dev/null +++ b/hadoop/streaming/no_reducer/input @@ -0,0 +1,8 @@ +a +b +c +d +e +f +g +h diff --git a/hadoop/streaming/no_reducer/no_reducer.rb b/hadoop/streaming/no_reducer/no_reducer.rb new file mode 100755 index 0000000..4410b93 --- /dev/null +++ b/hadoop/streaming/no_reducer/no_reducer.rb @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby + + +i = 0 +while l = STDIN.gets + puts "line #{i} (#{l.strip})" + i+=1 +end + diff --git a/hadoop/streaming/no_reducer/no_reducer.sh b/hadoop/streaming/no_reducer/no_reducer.sh new file mode 100755 index 0000000..c32bfdd --- /dev/null +++ b/hadoop/streaming/no_reducer/no_reducer.sh @@ -0,0 +1,23 @@ +#!/bin/sh + + +hadoop dfs -put input input + +HADOOP_HOME=/usr/lib/hadoop +HADOOP_VERSION=0.20.2-cdh3u1 +JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar +HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" + +OUT=no_reducer_out + +$HSTREAMING \ + -input input \ + -output $OUT \ + -mapper "no_reducer.rb" \ + -file "no_reducer.rb" \ + -reducer NONE + +hadoop dfs -get $OUT . +hadoop dfs -rmr $OUT +hadoop dfs -rm input + diff --git a/hadoop/streaming/partitioner/input b/hadoop/streaming/partitioner/input new file mode 100644 index 0000000..06c6a28 --- /dev/null +++ b/hadoop/streaming/partitioner/input @@ -0,0 +1,8 @@ +1.1 a +2.2 b +3.1 c +4.2 d +4.1 e +1.2 x +2.1 y +4.3 q diff --git a/hadoop/streaming/partitioner/partitioner_test.sh b/hadoop/streaming/partitioner/partitioner_test.sh new file mode 100755 index 0000000..bfb2185 --- /dev/null +++ b/hadoop/streaming/partitioner/partitioner_test.sh @@ -0,0 +1,22 @@ +#!/bin/sh + + +hadoop dfs -put input input + +HADOOP_HOME=/usr/lib/hadoop +HADOOP_VERSION=0.20.2-cdh3u1 +JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar +HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" + +OUT=partitioner_test_out + +$HSTREAMING \ + -input input \ + -output $OUT \ + -mapper /bin/cat \ + -jobconf mapred.reduce.tasks=2 + +hadoop dfs -get $OUT . +hadoop dfs -rmr $OUT +hadoop dfs -rm input + diff --git a/hadoop/streaming/partitioner/partitioner_test1.sh b/hadoop/streaming/partitioner/partitioner_test1.sh new file mode 100755 index 0000000..759f823 --- /dev/null +++ b/hadoop/streaming/partitioner/partitioner_test1.sh @@ -0,0 +1,27 @@ +#!/bin/sh + + +hadoop dfs -put input input + +HADOOP_HOME=/usr/lib/hadoop +HADOOP_VERSION=0.20.2-cdh3u1 +JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar +HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" + +OUT=partitioner_test1_out + +$HSTREAMING \ + -input input \ + -output $OUT \ + -mapper /bin/cat \ + -jobconf mapred.reduce.tasks=2 \ + -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner \ + -jobconf stream.map.output.field.separator="\t" \ + -jobconf map.output.key.field.separator=. \ + -jobconf stream.num.map.output.key.fields=2 \ + -jobconf mapred.text.key.partitioner.options=-k1 + +hadoop dfs -get $OUT . +hadoop dfs -rmr $OUT +hadoop dfs -rm input + diff --git a/hadoop/streaming/partitioner_test.input b/hadoop/streaming/partitioner_test.input deleted file mode 100644 index 06c6a28..0000000 --- a/hadoop/streaming/partitioner_test.input +++ /dev/null @@ -1,8 +0,0 @@ -1.1 a -2.2 b -3.1 c -4.2 d -4.1 e -1.2 x -2.1 y -4.3 q diff --git a/hadoop/streaming/partitioner_test.sh b/hadoop/streaming/partitioner_test.sh deleted file mode 100755 index dcc7353..0000000 --- a/hadoop/streaming/partitioner_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - - -hadoop dfs -put partitioner_test.input partitioner_test.input - -HADOOP_HOME=/usr/lib/hadoop -HADOOP_VERSION=0.20.2-cdh3u1 -JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar -HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" - -OUT=partitioner_out - -$HSTREAMING \ - -input partitioner_test.input \ - -output $OUT \ - -mapper /bin/cat \ - -jobconf mapred.reduce.tasks=2 - -hadoop dfs -get $OUT . -hadoop dfs -rmr $OUT -hadoop dfs -rm partitioner_test.input - diff --git a/hadoop/streaming/partitioner_test1.sh b/hadoop/streaming/partitioner_test1.sh deleted file mode 100755 index 6e6344c..0000000 --- a/hadoop/streaming/partitioner_test1.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - - -hadoop dfs -put partitioner_test.input partitioner_test.input - -HADOOP_HOME=/usr/lib/hadoop -HADOOP_VERSION=0.20.2-cdh3u1 -JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar -HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" - -OUT=partitioner1_out - -$HSTREAMING \ - -input partitioner_test.input \ - -output $OUT \ - -mapper /bin/cat \ - -jobconf mapred.reduce.tasks=2 \ - -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner \ - -jobconf stream.map.output.field.separator="\t" \ - -jobconf map.output.key.field.separator=. \ - -jobconf stream.num.map.output.key.fields=2 \ - -jobconf mapred.text.key.partitioner.options=-k1 - -hadoop dfs -get $OUT . -hadoop dfs -rmr $OUT -hadoop dfs -rm partitioner_test.input - diff --git a/hadoop/streaming/secondary_sort.input b/hadoop/streaming/secondary_sort.input deleted file mode 100644 index 5aa7ec9..0000000 --- a/hadoop/streaming/secondary_sort.input +++ /dev/null @@ -1,8 +0,0 @@ -0-*-1 a:1 a:2 a:3 -0-*-2 a:1 a:2 a:3 -0-*-10 a:1 a:2 a:3 -1-*-2 a:1 a:2 a:3 -2-*-0 a:1 a:2 a:3 -2-*-2 a:1 a:2 a:3 -3-*-3 a:1 a:2 a:3 -10-*-0 a:1 a:2 a:3 diff --git a/hadoop/streaming/secondary_sort.sh b/hadoop/streaming/secondary_sort.sh deleted file mode 100755 index 7fa0c6d..0000000 --- a/hadoop/streaming/secondary_sort.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - - -hadoop dfs -put secondary_sort.input secondary_sort.input - -HADOOP_HOME=/usr/lib/hadoop -HADOOP_VERSION=0.20.2-cdh3u1 -JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar -HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" - -OUT=comp_out - -$HSTREAMING \ - -input secondary_sort.input \ - -output $OUT \ - -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner \ - -jobconf map.output.key.field.separator="-*-" \ - -jobconf mapred.text.key.partitioner.options="-k1,1n" \ - -mapper /bin/cat \ - -reducer org.apache.hadoop.mapred.lib.IdentityReducer \ - -jobconf mapred.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator \ - -jobconf stream.num.map.output.key.fields=2 \ - -jobconf stream.map.output.field.separator="\t" \ - -jobconf mapred.text.key.comparator.options="-k1,1n -k2,2nr" \ - -jobconf mapred.reduce.tasks=3 - -hadoop dfs -get $OUT . -hadoop dfs -rmr $OUT -hadoop dfs -rm secondary_sort.input - diff --git a/hadoop/streaming/secondary_sort/input b/hadoop/streaming/secondary_sort/input new file mode 100644 index 0000000..5aa7ec9 --- /dev/null +++ b/hadoop/streaming/secondary_sort/input @@ -0,0 +1,8 @@ +0-*-1 a:1 a:2 a:3 +0-*-2 a:1 a:2 a:3 +0-*-10 a:1 a:2 a:3 +1-*-2 a:1 a:2 a:3 +2-*-0 a:1 a:2 a:3 +2-*-2 a:1 a:2 a:3 +3-*-3 a:1 a:2 a:3 +10-*-0 a:1 a:2 a:3 diff --git a/hadoop/streaming/secondary_sort/secondary_sort.sh b/hadoop/streaming/secondary_sort/secondary_sort.sh new file mode 100755 index 0000000..c45f381 --- /dev/null +++ b/hadoop/streaming/secondary_sort/secondary_sort.sh @@ -0,0 +1,30 @@ +#!/bin/sh + + +hadoop dfs -put input input + +HADOOP_HOME=/usr/lib/hadoop +HADOOP_VERSION=0.20.2-cdh3u1 +JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar +HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" + +OUT=secondary_sort_out + +$HSTREAMING \ + -input input \ + -output $OUT \ + -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner \ + -jobconf map.output.key.field.separator="-*-" \ + -jobconf mapred.text.key.partitioner.options="-k1,1n" \ + -mapper /bin/cat \ + -reducer org.apache.hadoop.mapred.lib.IdentityReducer \ + -jobconf mapred.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator \ + -jobconf stream.num.map.output.key.fields=2 \ + -jobconf stream.map.output.field.separator="\t" \ + -jobconf mapred.text.key.comparator.options="-k1,1n -k2,2nr" \ + -jobconf mapred.reduce.tasks=3 + +hadoop dfs -get $OUT . +hadoop dfs -rmr $OUT +hadoop dfs -rm input + diff --git a/hadoop/streaming/test.input b/hadoop/streaming/test.input deleted file mode 100644 index 338fd87..0000000 --- a/hadoop/streaming/test.input +++ /dev/null @@ -1,10 +0,0 @@ -0 1 a c -0 2 b c -0 3 c c -1 4 a c -1 5 b c -1 6 c c -1 7 d c -2 8 a c -2 9 b c -2 10 c c diff --git a/hadoop/streaming/test.sh b/hadoop/streaming/test.sh deleted file mode 100755 index 3cb47d5..0000000 --- a/hadoop/streaming/test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - - -hadoop dfs -put test.input test.input - -HADOOP_HOME=/usr/lib/hadoop -HADOOP_VERSION=0.20.2-cdh3u1 -JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar -HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" - -OUT=test_out - -$HSTREAMING \ - -input test.input \ - -output $OUT \ - -mapper /bin/cat \ - -jobconf "mapred.reduce.tasks=3" \ - -reducer org.apache.hadoop.mapred.lib.IdentityReducer - -hadoop dfs -get $OUT . -hadoop dfs -rmr $OUT -hadoop dfs -rm test.input - diff --git a/hadoop/streaming/test/input b/hadoop/streaming/test/input new file mode 100644 index 0000000..338fd87 --- /dev/null +++ b/hadoop/streaming/test/input @@ -0,0 +1,10 @@ +0 1 a c +0 2 b c +0 3 c c +1 4 a c +1 5 b c +1 6 c c +1 7 d c +2 8 a c +2 9 b c +2 10 c c diff --git a/hadoop/streaming/test/test.sh b/hadoop/streaming/test/test.sh new file mode 100755 index 0000000..2f09bac --- /dev/null +++ b/hadoop/streaming/test/test.sh @@ -0,0 +1,23 @@ +#!/bin/sh + + +hadoop dfs -put input input + +HADOOP_HOME=/usr/lib/hadoop +HADOOP_VERSION=0.20.2-cdh3u1 +JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar +HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR" + +OUT=test_out + +$HSTREAMING \ + -input input \ + -output $OUT \ + -mapper /bin/cat \ + -jobconf "mapred.reduce.tasks=3" \ + -reducer org.apache.hadoop.mapred.lib.IdentityReducer + +hadoop dfs -get $OUT . +hadoop dfs -rmr $OUT +hadoop dfs -rm input + -- cgit v1.2.3