【发布时间】:2020-02-06 10:37:11
【问题描述】:
我正在修改 Record Reader 中的 MapReduce 程序,并想为 mapper 编写一个测试用例,以调用自定义的 InputFormat 或 Record Reader。我已经修改了记录阅读器的测试用例,但记录阅读器测试用例不是 mrunit 的。
如何从Mapper调用自定义的Record Reader,因为MapDriver.newMapDriver下没有列出withInputFormat函数?
请找到我的代码快照:
@Before
public void setUp(){
MapDriver<Object, Text, Text, Text> mapDriver = MapDriver.newMapDriver(new myMapper());
}
@Test
public void testFunction1() throws IOException {
mapDriver.withInput(...).withOutput(...).runTest();
}
谢谢
【问题讨论】:
-
好吧,
MRUnit在其 API 中有withOutputFormat方法。我想会有withInputFormat。这是个好问题!