private static void createOutputMap(Map<String,List<Distributable>> outputMap,int blocksPerNode,Set<Distributable> uniqueBlocks,Map<String,List<Distributable>> nodeAndBlockMapping,List<String> activeNodes){
  ArrayList<NodeMultiBlockRelation> multiBlockRelations=new ArrayList<>(nodeAndBlockMapping.size());
  for (  Map.Entry<String,List<Distributable>> entry : nodeAndBlockMapping.entrySet()) {
    multiBlockRelations.add(new NodeMultiBlockRelation(entry.getKey(),entry.getValue()));
  }
  Collections.sort(multiBlockRelations);
  for (  NodeMultiBlockRelation nodeMultiBlockRelation : multiBlockRelations) {
    String nodeName=nodeMultiBlockRelation.getNode();
    String activeExecutor=nodeName;
    if (null != activeNodes) {
      activeExecutor=getActiveExecutor(activeNodes,nodeName);
      if (null == activeExecutor) {
        continue;
      }
    }
    int nodeCapacity=0;
    for (    Distributable block : nodeMultiBlockRelation.getBlocks()) {
      if (uniqueBlocks.contains(block)) {
        if (null == outputMap.get(activeExecutor)) {
          List<Distributable> list=new ArrayList<Distributable>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
          outputMap.put(activeExecutor,list);
        }
        if (nodeCapacity < blocksPerNode) {
          List<Distributable> infos=outputMap.get(activeExecutor);
          infos.add(block);
          nodeCapacity++;
          uniqueBlocks.remove(block);
        }
 else {
          break;
        }
      }
    }
  }
}

private static void createOutputMap ( Map < String , List < Distributable > > outputMap , int blocksPerNode , Set < Distributable > uniqueBlocks , Map < String , List < Distributable > > nodeAndBlockMapping , List < String > activeNodes ) { ArrayList < NodeMultiBlockRelation > multiBlockRelations = new ArrayList < > ( nodeAndBlockMapping . size ( ) ) ; for ( Map . Entry < String , List < Distributable > > entry : nodeAndBlockMapping . entrySet ( ) ) { multiBlockRelations . add ( new NodeMultiBlockRelation ( entry . getKey ( ) , entry . getValue ( ) ) ) ; } Collections . sort ( multiBlockRelations ) ; for ( NodeMultiBlockRelation nodeMultiBlockRelation : multiBlockRelations ) { String nodeName = nodeMultiBlockRelation . getNode ( ) ; String activeExecutor = nodeName ; if ( null != activeNodes ) { activeExecutor = getActiveExecutor ( activeNodes , nodeName ) ; if ( null == activeExecutor ) { continue ; } } int nodeCapacity = 0 ; for ( Distributable block : nodeMultiBlockRelation . getBlocks ( ) ) { if ( uniqueBlocks . contains ( block ) ) { if ( null == outputMap . get ( activeExecutor ) ) { List < Distributable > list = new ArrayList < Distributable > ( CarbonCommonConstants . DEFAULT_COLLECTION_SIZE ) ; outputMap . put ( activeExecutor , list ) ; } if ( nodeCapacity < blocksPerNode ) { List < Distributable > infos = outputMap . get ( activeExecutor ) ; infos . add ( block ) ; nodeCapacity ++ ; uniqueBlocks . remove ( block ) ; } else { break ; } } } } }
to create the final output of the node and data blocks
