0

在新的 Hadoop api 中,我可以从context.

但是现在我使用的是旧的 api,如何在旧的 map/reduce 的 reduce 中获取当前配置?

4

1 回答 1

0

在旧 API 中,有一个 configure 方法(类似于新 API 中的 setup),您可以从中获取 conf,如下所示:

public void configure(JobConf conf) {
    int test = conf.getInt("test", 0));
    String testString = conf.get("testString", "default");
}

您还可以使用此方法获取 DistributedCache(在新 API 中已弃用)。

于 2015-07-27T10:36:06.053 回答