Hadoop?????????????ú????MRUnit
???????????? ???????[ 2013/12/11 10:55:14 ] ????????
???????
????hadoop??mapreduce????????????г???????λ?????鷳????????????????????????????????????С??????????????????????????????????????б???????????????????????????????????bug????????е???????????????????????????л????????????????
?????????mapreduce????????????Щ?????????Map??Reduce?Щ???????????????????hadoop????????????OutputCollector??Reporter??InputSplit??????????Mock??Ρ???дmapreduce??????????????д?????????Mock????????????????????????MRUnit????д????????????о?????2??????MRUnit??????hadoop mapreduceд???????????API????????????á???????Щ?????????????粻???MultipleOutputs?????????????????MultipleOutputs????????????????潫??????????MRUnit?????MultipleOutputs????
????MRUnit
????MRUnit????????????????????????Driver??
???? MapDriver??????????Map?????
???? ReduceDriver??????????Reduce?????
???? MapReduceDriver????Map??Reduce?????????????
???? PipelineMapReduceDriver???????Map-Reduce pair???????
????MapDriver
????????????Map??????????????????????????????????????Map????????η??????????????Map??????
//??????????Map
private Map mapper;
private MapDriver<LongWritable?? Text?? Text?? TimeInfo> mapDriver;
@Before
public void setUp() {
mapper = new Map();
mapDriver = new MapDriver<LongWritable?? Text?? Text?? TimeInfo>();
}
@Test
public void testMap_timeFormat2() {
String sellerId = "444";
//?????????У?withInput???????????????????????????????(sellerId) //????????? ?10С?.
//?????????????sellerId?key??value?????1??10С???TimeInfo???? //??withOutput??
//??????????????Map????????????????????????????
Text mapInputValue = new Text("……");
mapDriver.withMapper(mapper)
.withInput(null?? mapInputValue)
.withOutput(new Text(sellerId)?? new TimeInfo(1?? 10))
.runTest();
}
|
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11