You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Piyush Kansal <pi...@gmail.com> on 2012/02/25 01:40:33 UTC

Query regarding MultipleOutputs for Hadoop 0.20.203

Hi,

I am trying to use MultipleOutputs in Reducer. For that, I am trying to
construct its object using in Reducer.setup() as follows:

    public static class MOReduce extends Reducer<Text, Integer, Text,
Integer> {
        private MultipleOutputs mos;

        public void setup( Reducer.Context context ) {
            mos = new MultipleOutputs( *context.getConfiguration()* );
        }

But I am facing problem because of following:
- as per the documentation<http://hadoop.apache.org/common/docs/r0.20.1/api/org/apache/hadoop/mapreduce/Reducer.html#setup%28org.apache.hadoop.mapreduce.Reducer.Context%29>,
setup function takes Reducer.Context as argument
- while as per this
documentation<http://hadoop.apache.org/common/docs/r0.20.1/api/org/apache/hadoop/mapred/lib/MultipleOutputs.html#MultipleOutputs%28org.apache.hadoop.mapred.JobConf%29>,
MultipleOutputs constructor needs JobConf. So, basically *I have no way to
extract JobConf from Reducer.Context*
- I already tried for any function like Reducer.Context.getConfXXX which
returns JobConf but there is just one function getConfiguration() which
returns JobContext

So, can you please suggest how I can solve this problem and instantiate the
MultipleOutputs object.

-- 
Regards,
Piyush Kansal