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/no_reducer/input | 8 ++++++++ hadoop/streaming/no_reducer/no_reducer.rb | 9 +++++++++ hadoop/streaming/no_reducer/no_reducer.sh | 23 +++++++++++++++++++++++ 3 files changed, 40 insertions(+) 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 (limited to 'hadoop/streaming/no_reducer') 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 + -- cgit v1.2.3