private List<FileStatus> getFiles(FileSystem fs, Path dir, long startTime, long endTime)
    throws IOException {
    List<FileStatus> result = new ArrayList<>();
    LOG.debug("Scanning " + dir.toString() + " for WAL files");
    RemoteIterator<LocatedFileStatus> iter = fs.listLocatedStatus(dir);
    if (!iter.hasNext()) {
      return Collections.emptyList();
    }
    while (iter.hasNext()) {
      LocatedFileStatus file = iter.next();
      if (file.isDirectory()) {
        // Recurse into sub directories
        result.addAll(getFiles(fs, file.getPath(), startTime, endTime));
      } else {
        addFile(result, file, startTime, endTime);
      }
    }
    // TODO: These results should be sorted? Results could be content of recovered.edits directory
    // -- null padded increasing numeric -- or a WAL file w/ timestamp suffix or timestamp and
    // then meta suffix. See AbstractFSWALProvider#WALStartTimeComparator
    return result;
  }
@param startTime If file looks like it has a timestamp in its name, we'll check if newer or
                 equal to this value else we will filter out the file. If name does not seem to
                 have a timestamp, we will just return it w/o filtering.
@param endTime   If file looks like it has a timestamp in its name, we'll check if older or
                 equal to this value else we will filter out the file. If name does not seem to
                 have a timestamp, we will just return it w/o filtering.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALInputFormat.java