Solved! Thank you!
2009/7/8 Stuart White <[email protected]>
> 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 <[email protected]> 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