当链中的第一个映射器从HBase表中读取时,是否可以链接多个映射器?也就是说,将ChainMapper与TableMapReduceUtil一起使用?
我试图对从HBase检索到的每条记录执行一些转换,但我无法使其正常工作。
这里有一个代码剪切,试图使用这两个:
Job job = new Job(hBaseConfig, "Retrieving data from HBase");
job.setJarByClass(DataRetrievalDriver.class);
Scan scan = scanCreator.getScan();
TableMapReduceUtil.initTableMapperJob(
table,
scan,
DataRetrievalMapper.class,
Text.class,
ElementWritable.class,
job,
true,
SaltTableInputFormat.class
);
ChainMapper.addMapper(job, TransformMapper.class, Text.class, ElementWritable.class, Text.class, ElementWritable.class, new Configuration());
SequenceFileOutputFormat.setOutputPath(job, new Path("out"));
job.setReducerClass(Reducer.class);
job.setNumReduceTasks(1);
job.waitForCompletion(true);