private Map<UUID,Collection<HadoopInputSplit>> mappers(Collection<ClusterNode> top,Collection<UUID> topIds,Iterable<HadoopInputSplit> splits) throws IgniteCheckedException {
  Map<UUID,Collection<HadoopInputSplit>> mappers=new HashMap<>();
  Map<String,Collection<UUID>> nodes=groupByHost(top);
  Map<UUID,Integer> nodeLoads=new HashMap<>(top.size(),1.0f);
  for (  UUID nodeId : topIds)   nodeLoads.put(nodeId,0);
  for (  HadoopInputSplit split : splits) {
    UUID nodeId=nodeForSplit(split,topIds,nodes,nodeLoads);
    if (log.isDebugEnabled())     log.debug("Mapped split to node [split=" + split + ", nodeId="+ nodeId+ ']');
    Collection<HadoopInputSplit> nodeSplits=mappers.get(nodeId);
    if (nodeSplits == null) {
      nodeSplits=new ArrayList<>();
      mappers.put(nodeId,nodeSplits);
    }
    nodeSplits.add(split);
    nodeLoads.put(nodeId,nodeLoads.get(nodeId) + 1);
  }
  return mappers;
}

private Map < UUID , Collection < HadoopInputSplit > > mappers ( Collection < ClusterNode > top , Collection < UUID > topIds , Iterable < HadoopInputSplit > splits ) throws IgniteCheckedException { Map < UUID , Collection < HadoopInputSplit > > mappers = new HashMap < > ( ) ; Map < String , Collection < UUID > > nodes = groupByHost ( top ) ; Map < UUID , Integer > nodeLoads = new HashMap < > ( top . size ( ) , 1.0f ) ; for ( UUID nodeId : topIds ) nodeLoads . put ( nodeId , 0 ) ; for ( HadoopInputSplit split : splits ) { UUID nodeId = nodeForSplit ( split , topIds , nodes , nodeLoads ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "Mapped split to node [split=" + split + ", nodeId=" + nodeId + ']' ) ; Collection < HadoopInputSplit > nodeSplits = mappers . get ( nodeId ) ; if ( nodeSplits == null ) { nodeSplits = new ArrayList < > ( ) ; mappers . put ( nodeId , nodeSplits ) ; } nodeSplits . add ( split ) ; nodeLoads . put ( nodeId , nodeLoads . get ( nodeId ) + 1 ) ; } return mappers ; }
create plan for mappers .
