private static Scan getConfiguredScanForJob(Configuration conf, String[] args)
    throws IOException {
    // create scan with any properties set from TableInputFormat
    Scan s = TableInputFormat.createScanFromConfiguration(conf);
    // Set Scan Versions
    if (conf.get(TableInputFormat.SCAN_MAXVERSIONS) == null) {
      // default to all versions unless explicitly set
      s.readVersions(Integer.MAX_VALUE);
    }
    s.setCacheBlocks(false);
    // Set RowFilter or Prefix Filter if applicable.
    Filter rowFilter = getRowFilter(args);
    if (rowFilter != null) {
      LOG.info("Setting Row Filter for counter.");
      s.setFilter(rowFilter);
    }
    // Set TimeRange if defined
    long timeRange[] = getTimeRange(args);
    if (timeRange != null) {
      LOG.info("Setting TimeRange for counter.");
      s.setTimeRange(timeRange[0], timeRange[1]);
    }
    return s;
  }
Sets up the actual job.
@param conf The current configuration.
@param args The command line parameters.
@return The newly created job.
@throws IOException When setting up the job fails.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java