0

我需要有关地图文件阅读器的帮助。 我通过 -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 = file:/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 init error - java.hadoop.FileNotrainingException /hadoop file:/file_work/: /mapred/nodemanager/usercache/hadoop/appcache/application_1394318775013_0079/container_1394318775013_0079_01_000005/mapFileTestFolder.tar.gz/mapFileTestFolder/data 不存在

mapFileTestFolder.tar.gz - 这是一个压缩的地图文件文件(其中包含索引和数据)

我猜这个文件存在于分布式缓存中,因为如果相同匹配,跑步者会进入条件。
为什么会这样?=/感谢

任何帮助
谢谢

4

1 回答 1

0

问题解决了。我的愚蠢错误=/我应该使用将存档添加到分布式缓存的命令,而不是作为文件。

于 2014-03-13T10:24:12.107 回答