hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johnson Chen <dong...@gmail.com>
Subject Re: Can mapper use MultipleOutputs ??
Date Wed, 08 Jul 2009 13:39:38 GMT
Solved! Thank you!

2009/7/8 Stuart White <stuart.white1@gmail.com>

> Are you calling mos.close() in your Mapper's close() method?  For example:
>
> public static class Map extends MapReduceBase implements Mapper {
>
> (... all the stuff you already have ...)
>
>   @Override
>   public void close() throws IOException {
>      mos.close();
>    }
> }
>
>
>
> On Wed, Jul 8, 2009 at 4:28 AM, Johnson Chen <dongogo@gmail.com> wrote:
>
> > Hi ,
> > I want to output data from each Mapper , so I write the following code.
> >
> > public static class Map extends MapReduceBase implements Mapper {
> >            private MultipleOutputs mos ;
> >
> >             public void configure(JobConf job) {
> >                         mos = new MultipleOutputs(job);
> >             }
> >
> >            mos.getCollector("hashtable", reporter).collect( new Text(
> > output_data )  , new Text(""));
> >            ...
> > }
> >
> > I got hashtable-m-00000 ~ hahashtable-m-00009 files.
> >
> > But when I looked into these files ,  they were all empty .
> >
> > However , when I put MultipleOutputs in Reducer , it works!
> >
> >
> > Why ? Can Mapper use MultipleOutputs ?
> >
> >
> >
> >
> > --
> > Best wishes,
> > Johnson Chen
> >
>



-- 
Best wishes,
Johnson Chen

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message