code: public List<FileStatusExtended> getRandomFilesSample(double percentage) {
      if (!(percentage > 0 && percentage <= 1.0)) {
        throw new IllegalArgumentException("Invalid percentage : " + percentage +
            " value should be between (0 - 1.0]");
      }
      LOG.info("Sampling : " + (percentage * 100) + " percent of files");
      return namesystem.getRandomFiles(percentage);
    }
docs: Get a sample of the total files in the FileSystem. The sampling is done
  randomly.
  
  @param percentage
  the percentage of files to sample, value should be between (0 -
  1.0]
  @return the list of files