private Map<HadoopInputSplit,Integer> assignReducersToSplits(Collection<HadoopInputSplit> splits,int reducerCnt){
  Map<HadoopInputSplit,Integer> res=new IdentityHashMap<>(splits.size());
  int base=reducerCnt / splits.size();
  int remainder=reducerCnt % splits.size();
  for (  HadoopInputSplit split : splits) {
    int val=base;
    if (remainder > 0) {
      val++;
      remainder--;
    }
    res.put(split,val);
  }
  assert remainder == 0;
  return res;
}

private Map < HadoopInputSplit , Integer > assignReducersToSplits ( Collection < HadoopInputSplit > splits , int reducerCnt ) { Map < HadoopInputSplit , Integer > res = new IdentityHashMap < > ( splits . size ( ) ) ; int base = reducerCnt / splits . size ( ) ; int remainder = reducerCnt % splits . size ( ) ; for ( HadoopInputSplit split : splits ) { int val = base ; if ( remainder > 0 ) { val ++ ; remainder -- ; } res . put ( split , val ) ; } assert remainder == 0 ; return res ; }
distribute reducers between splits .
