我使用了org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil中的以下API,其中包含hadoop 1和hbase 0.94
public static void initTableMapperJob(List<Scan> scans,
Class<? extends TableMapper> mapper,
Class<? extends WritableComparable> outputKeyClass,
Class<? extends Writable> outputValueClass, Job job) throws IOException {
initTableMapperJob(scans, mapper, outputKeyClass, outputValueClass, job,
true);
}
TableMapReduceUtil.initTableMapperJob(scans, Stage1Mapper.class, ImmutableBytesWritable.class, Result.class, job);
现在它给了我hadoop 2和hbase 0.98的编译错误。我认为主要是hbase 0.98有问题。错误是:
The method initTableMapperJob(List<Scan>, Class<? extends TableMapper>, Class<? extends WritableComparable>, Class<? extends Writable>, Job) in the type TableMapReduceUtil is not applicable for the arguments (List<Scan>, Class<PlanStage1Mapper>, Class<ImmutableBytesWritable>, Class<Result>, Job)
使用hbase 0.98 Result类不再实现Writable接口,initTableMapperJob期望实现Writable的东西。有没有更好的替代方法来解决这个问题?