code: public List<InputSplit> getSplits(JobContext job
                                      ) throws IOException {
      long minSize = Math.max(getFormatMinSplitSize(), getMinSplitSize(job));
      long maxSize = getMaxSplitSize(job);
  
      // generate splits
      List<InputSplit> splits = new ArrayList<InputSplit>();
      for (LocatedFileStatus file: listLocatedStatus(job)) {
        Path path = file.getPath();
        long length = file.getLen();
        BlockLocation[] blkLocations = file.getBlockLocations();
  
        if ((length != 0) && isSplitable(job, path)) { 
          long blockSize = file.getBlockSize();
          long splitSize = computeSplitSize(blockSize, minSize, maxSize);
  
          long bytesRemaining = length;
          while (((double) bytesRemaining)/splitSize > SPLIT_SLOP) {
            int blkIndex = getBlockIndex(blkLocations, length-bytesRemaining);
            splits.add(new FileSplit(path, length-bytesRemaining, splitSize, 
                                     blkLocations[blkIndex].getHosts()));
            bytesRemaining -= splitSize;
          }
          
          if (bytesRemaining != 0) {
            splits.add(new FileSplit(path, length-bytesRemaining, bytesRemaining, 
                       blkLocations[blkLocations.length-1].getHosts()));
          }
        } else if (length != 0) {
          splits.add(new FileSplit(path, 0, length, blkLocations[0].getHosts()));
        } else { 
          //Create empty hosts array for zero length files
          splits.add(new FileSplit(path, 0, length, new String[0]));
        }
      }
      LOG.debug("Total # of splits: " + splits.size());
      return splits;
    }
docs: Generate the list of files and make them into FileSplits.