code: private static int setReducerCount(long fileCount, JobConf job, 
        JobClient client) {
      // calculate the max number of reducers.
      int numReducers = Math.max(job.getInt(MAX_REDUCE_LABEL, MAX_REDUCERS_DEFAULT),
          (int) (fileCount / job.getInt(MAX_FILES_PER_REDUCER_LABEL, 
              MAX_FILES_PER_REDUCER_DEFAULT)));
      
      // make sure we at least have 1.
      numReducers = Math.max(numReducers, 1);
      job.setNumReduceTasks(numReducers);
      return numReducers;
    }
docs: Calculate how many reducers to run.
  @param fileCount
  @param job
  @param client
  @return