【问题标题】:Hadoop MapFile reader doesn't detect a file in distributed CacheHadoop MapFile 阅读器未检测到分布式缓存中的文件
【发布时间】:2014-03-13 18:24:12
【问题描述】:

我需要有关地图文件阅读器的帮助。
我通过 -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_13943187501_005070 /mapFileTestFolder.tar.gz/mapFileTestFolder

2014-03-11 08:31:09,345 INFO [main] rsProject.myReducer: depReader init error - 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/数据不存在

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

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

任何帮助表示赞赏
谢谢

【问题讨论】:

    标签: java hadoop mapreduce distributed-cache map-files


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多