本文整理汇总了Java中org.apache.hadoop.mapreduce.MRConfig.LOCAL_DIR属性的典型用法代码示例。如果您正苦于以下问题:Java MRConfig.LOCAL_DIR属性的具体用法?Java MRConfig.LOCAL_DIR怎么用?Java MRConfig.LOCAL_DIR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.hadoop.mapreduce.MRConfig
的用法示例。
在下文中一共展示了MRConfig.LOCAL_DIR属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setConf
public void setConf(Configuration conf) {
if (conf instanceof JobConf) {
this.conf = (JobConf) conf;
} else {
this.conf = new JobConf(conf);
}
this.mapOutputFile = ReflectionUtils.newInstance(
conf.getClass(MRConfig.TASK_LOCAL_OUTPUT_CLASS,
MROutputFiles.class, MapOutputFile.class), conf);
this.lDirAlloc = new LocalDirAllocator(MRConfig.LOCAL_DIR);
// add the static resolutions (this is required for the junit to
// work on testcases that simulate multiple nodes on a single physical
// node.
String hostToResolved[] = conf.getStrings(MRConfig.STATIC_RESOLUTIONS);
if (hostToResolved != null) {
for (String str : hostToResolved) {
String name = str.substring(0, str.indexOf('='));
String resolvedName = str.substring(str.indexOf('=') + 1);
NetUtils.addStaticResolution(name, resolvedName);
}
}
}
示例2: FileCache
public FileCache(Configuration conf)
throws IOException {
this.conf = conf;
this.fs = FileSystem.getLocal(conf);
this.lDirAlloc = new LocalDirAllocator(MRConfig.LOCAL_DIR);
}