0
我正嘗試在Reducer中使用MultipleOutputs,以便使用分區程序寫入多個文件。對於這一點,我想構建使用Reducer.setup()的對象,如下所示:有關MultipleOutputs for Hadoop的查詢0.20.203
public static class MOReduce extends Reducer<Text, Integer, Text, Integer> {
private MultipleOutputs mos;
public void setup(Reducer.Context context) {
mos = new MultipleOutputs(context.getConfiguration());
}
但我面對的是因爲以下問題:
- 按照該documentation,設置功能需要Reducer.Context作爲參數
- 而按照此documentation,MultipleOutputs構造函數需要JobConf。所以,基本上我就沒有辦法從Reducer.Context
- 我已經嘗試過像Reducer.Context.getConfXXX返回JobConf任何函數提取JobConf但只有一個功能getConfiguration()返回JobContext
那麼,你能否建議我如何解決這個問題並實例化MultipleOutputs對象。
謝謝拉維。我會嘗試。 – 2012-02-26 00:18:45