public static Map<URI,List<Initiator>> makeHostInitiatorsMap(List<URI> initiators,DbClient dbClient){
  Map<URI,List<Initiator>> hostInitiatorMap=new HashMap<>();
  if (!initiators.isEmpty()) {
    for (    URI initiatorUri : initiators) {
      Initiator initiator=dbClient.queryObject(Initiator.class,initiatorUri);
      URI initiatorHostURI=VPlexUtil.getInitiatorHost(initiator);
      List<Initiator> initiatorSet=hostInitiatorMap.get(initiatorHostURI);
      if (initiatorSet == null) {
        hostInitiatorMap.put(initiatorHostURI,new ArrayList<Initiator>());
        initiatorSet=hostInitiatorMap.get(initiatorHostURI);
      }
      initiatorSet.add(initiator);
    }
  }
  _log.info("assembled map of hosts to initiators: " + hostInitiatorMap);
  return hostInitiatorMap;
}

public static Map < URI , List < Initiator > > makeHostInitiatorsMap ( List < URI > initiators , DbClient dbClient ) { Map < URI , List < Initiator > > hostInitiatorMap = new HashMap < > ( ) ; if ( ! initiators . isEmpty ( ) ) { for ( URI initiatorUri : initiators ) { Initiator initiator = dbClient . queryObject ( Initiator . class , initiatorUri ) ; URI initiatorHostURI = VPlexUtil . getInitiatorHost ( initiator ) ; List < Initiator > initiatorSet = hostInitiatorMap . get ( initiatorHostURI ) ; if ( initiatorSet == null ) { hostInitiatorMap . put ( initiatorHostURI , new ArrayList < Initiator > ( ) ) ; initiatorSet = hostInitiatorMap . get ( initiatorHostURI ) ; } initiatorSet . add ( initiator ) ; } } _log . info ( "assembled map of hosts to initiators: " + hostInitiatorMap ) ; return hostInitiatorMap ; }
given a list of initiator uris , make a map of host uri to a list of initiators .
