mapper会忽略哪些文件作为输入?

Mar*_*o L 8 hadoop ignore filter mapper

我正在链接多个MapReduce作业,并希望传递/存储一些元信息(例如配置或原始输入的名称)和结果.至少文件"_SUCCESS"以及目录"_logs"中的任何内容都会被忽略.

是否有任何文件名模式默认忽略InputReader?或者这只是一个固定的有限列表?

zsx*_*ing 14

FileInputFormat使用以下hiddenFileFilter默认情况下:

  private static final PathFilter hiddenFileFilter = new PathFilter(){
      public boolean accept(Path p){
        String name = p.getName(); 
        return !name.startsWith("_") && !name.startsWith("."); 
      }
    }; 
Run Code Online (Sandbox Code Playgroud)

所以,如果你使用的任何FileInputFormat(例如TextInputFormat,KeyValueTextInputFormat,SequenceFileInputFormat),隐藏文件(文件名以"_"或"")将被忽略.

您可以使用FileInputFormat.setInputPathFilter来设置自定义PathFilter.请记住,hiddenFileFilter它始终是活跃的.