Hi all,

Is it possible to pass an integer value from one M-R job to another? My 2nd
MR job reads the output of the 1st job but also i would like it to read
another integer value too.

I tried doing so with configure(JobConf conf) method. But how/where in the
reduce method should I use the conf.setInt() method? If I am trying to set
it n the configuration part i.e. after the call to JobClient.runJob(), then
it is unable to access the variables from the reduce method as they are out
of scope. Someone please help me with this.

The code is like :

public static class Map extends MapReduceBase implements
Mapper<LongWritable, Text, Text, FloatWritable>
    {
......................

}


public static class Reduce extends MapReduceBase implements Reducer<Text,
FloatWritable, Text, FloatWritable>
    {
 ...........
......
output.collect(t2, val2);    //* I need this value val2 for the next job (
val2 is a single floating point number). this input is in addition to
another input file the second job reads.*
}

   /***************************  job2 ********************************/

public static class Map2 extends MapReduceBase implements
Mapper<LongWritable, Text, Text, FloatWritable>
    {
        String[] str4;


        public void configure(JobConf conf2)
        {
            str4 = conf2.getInt("str_conf", 0);   //*My Question is WHERE do
I use the conf.setInt() method to set the value from the reduce of the 1st
job?*
         }


.....................
................
}


Thanks,
Sharath

Reply via email to