我需要有关mapfile阅读器的帮助。
我通过-files选项将文件添加到缓存中
yarn jar HadoopProjects.jar rsProject.driver -files hdfs:// localhost:8020 / data / mapFileTestFolder.tar.gz ....
这里我称之为
@SuppressWarnings("deprecation")
@Override
protected void setup(Context context) {
try {
Path[] cacheLocalFiles = DistributedCache.getLocalCacheFiles(context.getConfiguration());
logF.info("reducer started setup");
for (Path path:cacheLocalFiles) {
logF("reducer setup " + path.getName().toString());
if (path.getName().toString().contains("mapFileTestFolder.tar.gz")) {
URI mapUri = new File(path.toString() + "/mapFileTestFolder").toURI();
logF.info("depReader init begins URI = " + mapUri.toString());
depReader = new MapFile.Reader(FileSystem.get(context.getConfiguration()),mapUri.toString(), context.getConfiguration());
logF.info("depReader init ends");
}
}
} catch (IOException e) {
e.printStackTrace();
logF.info("depReader init error - " + e);
}
//some other lines
}
这是我在日志中看到的内容
2014-03-11 08:31:09,305 INFO [main] rsProject.myReducer: depReader init开始URI =文件:/ home / hadoop / Training / hadoop_work / mapred / nodemanager / usercache / hadoop / appcache / application_1394318775013_0079 / container_1394318775013_0079_01_000005 /mapFileTestFolder.tar.gz/mapFileTestFolder
2014-03-11 08:31:09,345 INFO [main] rsProject.myReducer:depReader初始化错误 - java.io.FileNotFoundException:文件文件:/ home / hadoop / Training / hadoop_work / mapred / nodemanager / usercache / hadoop /appcache/application_1394318775013_0079/container_1394318775013_0079_01_000005/mapFileTestFolder.tar.gz/mapFileTestFolder/data不存在
mapFileTestFolder.tar.gz - 这是一个压缩的地图文件文件(里面有索引和数据)
我想这个文件存在于分布式缓存中,因为如果匹配的话,运行器进入条件。
为什么会这样? = /
任何帮助表示赞赏
感谢
答案 0 :(得分:0)