@Override
  protected int doWork() throws Exception {
    job = createSubmittableJob(getConf());
    if (job == null) {
      return -1;
    }
    boolean success = job.waitForCompletion(true);
    final long expectedCount = getConf().getLong(EXPECTED_COUNT_KEY, -1);
    if (success && expectedCount != -1) {
      final Counter counter = job.getCounters().findCounter(RowCounterMapper.Counters.ROWS);
      success = expectedCount == counter.getValue();
      if (!success) {
        LOG.error("Failing job because count of '" + counter.getValue()
          + "' does not match expected count of '" + expectedCount + "'");
      }
    }
    return (success ? 0 : 1);
  }
Sets filter {@link FilterBase} to the {@link Scan} instance. If provided rowRangeList contains
more than one element, method sets filter which is instance of {@link MultiRowRangeFilter}. If
rowRangeList contains exactly one element, startRow and stopRow are set to the scan. Also,
method may apply {@link FirstKeyOnlyFilter} an {@link KeyOnlyFilter} for better performance.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java