Streaming has the ability to accept as input multiple directories, so that
would enable you to merge two directories

(--is this an assignment? ...)

Miles

2008/8/27 Leandro Alvim <[EMAIL PROTECTED]>

> Hi, I need help if it's possible.
>
> My name is Leandro Alvim and i`m a graduated in computer science in Brazil.
> So, i'm using hadoop in my university project and i used your tutorials to
> learn how to install and run a simple test with python and hadoop. Writing
> my application i faced a problem that i don't know how to solve. Here it
> comes:
>
> My linux shell script:
>
> input_path=/pls_in
> input=pls_input
> output_1=pls_out1
> output_2=pls_out2
> output_3=pls_out3
> output_4=pls_out4
>
> #deleting output directories
> $hadoop_path/bin/hadoop dfs -rmr $output_1
> $hadoop_path/bin/hadoop dfs -rmr $output_2
> $hadoop_path/bin/hadoop dfs -rmr $output_3
> $hadoop_path/bin/hadoop dfs -rmr $output_4
>
> *#mapreduce A*
> $hadoop_path/bin/hadoop jar
> $hadoop_path/contrib/streaming/hadoop-0.17.1-streaming.jar -input $input/*
> -output $output_1 -mapper $mapper_path/mapperA.py -reducer
> $reducer_path/reducerA.py -jobconf mapred.reduce.tasks=2 -jobconf
> mapred.map.tasks=2
>
> *#map B*
> $hadoop_path/bin/hadoop jar
> $hadoop_path/contrib/streaming/hadoop-0.17.1-streaming.jar -mapper
> $mapper_path/mapperB.py -input $input/* -output $output_2 -jobconf
> mapred.reduce.tasks=0 -jobconf mapred.map.tasks=2
>
> *#map C*
> $hadoop_path/bin/hadoop jar
> $hadoop_path/contrib/streaming/hadoop-0.17.1-streaming.jar -mapper
> $mapper_path/mapperC.py -input $output_1/* -output $output_3 -jobconf
> mapred.reduce.tasks=0 -jobconf mapred.map.tasks=2
>
> *#reduce B and C using the outputs *
> $hadoop_path/bin/hadoop jar
> $hadoop_path/contrib/streaming/hadoop-0.17.1-streaming.jar
> *-reducer*$reducer_path/reducerD.py
> * -input $output_2/* -input $output_3/* *-output $output_4  -jobconf
> mapred.reduce.tasks=2 -jobconf mapred.map.tasks=0
>
> *The problem is here. I can`t reduce using two previous files that was
> mapped in fase (mapB and mapC) to an output. *
>
> How can i use only a reduce without map?
>
> How can i join two directories in one that all files willl be ordened for
> the reducer fase?
>
>
> #listing the outputs
> $hadoop_path/bin/hadoop dfs -cat $output_1/*
> $hadoop_path/bin/hadoop dfs -cat $output_2/*
> $hadoop_path/bin/hadoop dfs -cat $output_3/*
> $hadoop_path/bin/hadoop dfs -cat $output_4/*
>
>
> --
> Atenciosamente,
> Leandro G.M. Alvim
>



-- 
The University of Edinburgh is a charitable body, registered in Scotland,
with registration number SC005336.

Reply via email to