private static void addFilesRecursively(JobContext job, FileStatus status,
    List<FileStatus> result) throws IOException {
    if (status.isDirectory()) {
      FileSystem fs = status.getPath().getFileSystem(job.getConfiguration());
      for (FileStatus fileStatus : fs.listStatus(status.getPath(), HIDDEN_FILE_FILTER)) {
        addFilesRecursively(job, fileStatus, result);
      }
    } else {
      result.add(status);
    }
  }
A private cache of the key value so it doesn't need to be loaded twice from the scanner.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileInputFormat.java