public static void setNumReduceTasks(String table, JobConf job) throws IOException {
    job.setNumReduceTasks(getRegionCount(HBaseConfiguration.create(job), TableName.valueOf(table)));
  }
Sets the number of reduce tasks for the given job configuration to the number of regions the
given table has.
@param table The table to get the region count for.
@param job   The current job configuration to adjust.
@throws IOException When retrieving the table details fails.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapred/TableMapReduceUtil.java