我一直在尋找mrunit文檔,但迄今未能找到它。 我如何在我的mrunit中傳遞配置參數。在mrunit中設置配置
因此,例如,如果我拿wordcount的例子。
可以說,在我的驅動程序代碼,我設置此參數...
conf.set("delimiter",args[2])
而在我的映射器的代碼,我調用此爲:
String delimiter = conf.get("delimiter");
String [] tokens = value.toString().split(delimiter);
for (String token:tokens)
context.write(token,one);
如何設置這個配置參數。
我一直在尋找到這個例子: https://github.com/wpm/Hadoop-Word-Count/blob/master/src/test/java/wpmcn/hadoop/WordCountTest.java
感謝
'withConfiguration'現在在新版本中已棄用。 – gyan