gpt4 book ai didi

hadoop - 哪些文件被映射器忽略为输入?

转载 作者:可可西里 更新时间:2023-11-01 14:14:28 26 4
gpt4 key购买 nike

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

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

最佳答案

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

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

因此,如果您使用任何 FileInputFormat(例如 TextInputFormatKeyValueTextInputFormatSequenceFileInputFormat),隐藏文件(文件名以“_”或“.”开头)将被忽略。

您可以使用 FileInputFormat.setInputPathFilter设置您的自定义 PathFilter。请记住,hiddenFileFilter 始终处于事件状态。

关于hadoop - 哪些文件被映射器忽略为输入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19830264/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com