Github user vasia commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/260#discussion_r21666686
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java ---
    @@ -506,6 +527,31 @@ public LocatableInputSplitAssigner 
getInputSplitAssigner(FileInputSplit[] splits
                return inputSplits.toArray(new 
FileInputSplit[inputSplits.size()]);
        }
     
    +   private long addNestedFiles(Path path, List<FileStatus> files, long 
length, boolean checkAccept) 
    +                   throws IOException {
    +           final FileSystem fs = path.getFileSystem();
    +
    +           for(FileStatus dir: fs.listStatus(path)) {
    +                   if (dir.isDir()) {
    +                           addNestedFiles(dir.getPath(), files, length, 
checkAccept);
    +                   }
    +                   else {
    +                           if (checkAccept) {
    +                                   if(acceptFile(dir)) {
    +                                           files.add(dir);
    +                                           length += dir.getLen();
    +                                           testForUnsplittable(dir);
    +                                   }
    +                           }
    +                           else {
    +                                   files.add(dir);
    +                                   testForUnsplittable(dir);
    --- End diff --
    
    no, the else block corresponds to the call from `getFileStats`, where the 
length calculation is performed after file enumeration. I did it this way 
trying not to change existing logic, but if you think it's confusing I can 
change it :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to