diff options
author | Patrick Simianer <p@simianer.de> | 2014-06-14 19:03:21 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-06-14 19:03:21 +0200 |
commit | 5ddc763ab9953eebdaf78af4eb72288d7955b310 (patch) | |
tree | fffaf3d22173feae684b7c02ce86c67cf77c7fec /hadoop/streaming/no_reducer | |
parent | 26c490f404731d053a6205719b6246502c07b449 (diff) |
cleanup
Diffstat (limited to 'hadoop/streaming/no_reducer')
-rw-r--r-- | hadoop/streaming/no_reducer/input | 8 | ||||
-rwxr-xr-x | hadoop/streaming/no_reducer/no_reducer.rb | 9 | ||||
-rwxr-xr-x | hadoop/streaming/no_reducer/no_reducer.sh | 23 |
3 files changed, 40 insertions, 0 deletions
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 + |