You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by "putra.manggala@gmail.com" <pu...@gmail.com> on 2012/08/06 22:03:44 UTC

Avro mapred and ChainMapper

Hello,

My mapper has the following details:

public class M1 extends MapReduceBase
implements Mapper<AvroWrapper<Record1>, NullWritable,
AvroKey<Record2>, AvroValue<Record3>> {

where Record1, Record2 and Record3 implement IndexedRecord

To drive this, I'd like to use ChainMapper, but the following two
approaches don't compile:

(1)

JobConf conf = new JobConf(getConf(), MyJob.class);
JobConf conf2 = new JobConf(false);

ChainMapper.addMapper(conf,
					M1.class,
								new AvroWrapper<Record1>().getClass(),
								NullWritable.class,
								new AvroKey<Record2>().getClass(),
								new AvroValue<Record3>().getClass(),
								true, 				conf2);


(2)

JobConf conf = new JobConf(getConf(), MyJob.class);
JobConf conf2 = new JobConf(false);

ChainMapper.addMapper(conf,
					M1.class, AvroWrapper.class, NullWritable.class, AvroKey.class,
AvroValue.class,
true, conf2);

Does anybody have any idea?