????hadoop????????mock????????
???????????? ???????[ 2012/12/26 10:42:44 ] ????????
????????
??????????????????????Toast???????????????????????????á???????????????о????????mock?????????????????Mock??????hadoop??????????????????????????????????????????????????Щ??????
????????????????????mock???????????????????????壬?????????????????????????????е???壬????????????????????????????
????1????????????
????2??????????
????3?????????????
????4???????????κε????????????
????5?????????ú?????????????
???????????????г?????????????????????????????????????Ч???????????????????????Ч???????????Щ?????????????????????????????????????壬????????????????????????????????????????????????????????????
????????????????????????????????????Ч??????????????????п????????????????????????????????????С???????????????mock???????滻???Щ??????????????????????Э????????????У?mock????????????Ч????????Ρ?
???????????hadoop?????????????????????????google?У???????????????????????????????
?????????????????hadoop????????????ο????????????????????????????????????mock????Ρ?????????????hadoop????????????????????С????Щ?????hadoop?????????Щ??????????????????
???????????????£????Mockito????hadoop?????????mock???????+ PowerMock????????hadoop????????????????????
??????????????????
?????????????????????ShopScanMap??
public class ShopScanMap extends TableMapper<Text?? Text> {
@Override
public void setup(Context context) throws IOException {
//…
Configuration conf = context.getConfiguration();
ht_shop_info = new HTable(conf?? Bytes.toBytes(ParaDefine.t_shop_info));
ht_bmw_users = new HTable(conf?? Bytes.toBytes(ParaDefine.t_bmw_users));
…
count_bmw = context.getCounter("Statistics"?? ParaDefine.t_bmw_shops);
//…
}
@Override
public void map(ImmutableBytesWritable inKey?? Result inValue??
Context context) throws IOException?? InterruptedException {
//????main_process????
}
private int main_process(Map<String?? String> mapOutPut??
Field_Bmw_Shops fBmwShops?? long shop_id?? TimeBill timeBill_shop??
TimeBill timeBill_user) throws IOException {
//…
Get gtShopInfo = new Get(r_shopinfo.getBytes());
Result rsShopInfo = ht_shop_info.get(gtShopInfo);
//…
}
}
??????
???·???
??????????????????
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