public static void reconcileExportGroupsHLUs(DbClient dbClient,ExportGroup exportGroup){
  List<String> egVolumesWithoutHLUs=findVolumesWithoutHLUs(exportGroup);
  if (!egVolumesWithoutHLUs.isEmpty()) {
    for (    ExportMask thisMask : ExportMaskUtils.getExportMasks(dbClient,exportGroup)) {
      Iterator<String> volumeIter=egVolumesWithoutHLUs.iterator();
      while (volumeIter.hasNext()) {
        URI volumeURI=URI.create(volumeIter.next());
        if (thisMask.hasVolume(volumeURI)) {
          String hlu=thisMask.returnVolumeHLU(volumeURI);
          if (hlu != ExportGroup.LUN_UNASSIGNED_DECIMAL_STR) {
            _log.info(String.format("ExportGroup %s (%s) update volume HLU: %s -> %s",exportGroup.getLabel(),exportGroup.getId(),volumeURI,hlu));
            exportGroup.addVolume(volumeURI,Integer.valueOf(hlu));
            volumeIter.remove();
          }
        }
      }
    }
  }
}

public static void reconcileExportGroupsHLUs ( DbClient dbClient , ExportGroup exportGroup ) { List < String > egVolumesWithoutHLUs = findVolumesWithoutHLUs ( exportGroup ) ; if ( ! egVolumesWithoutHLUs . isEmpty ( ) ) { for ( ExportMask thisMask : ExportMaskUtils . getExportMasks ( dbClient , exportGroup ) ) { Iterator < String > volumeIter = egVolumesWithoutHLUs . iterator ( ) ; while ( volumeIter . hasNext ( ) ) { URI volumeURI = URI . create ( volumeIter . next ( ) ) ; if ( thisMask . hasVolume ( volumeURI ) ) { String hlu = thisMask . returnVolumeHLU ( volumeURI ) ; if ( hlu != ExportGroup . LUN_UNASSIGNED_DECIMAL_STR ) { _log . info ( String . format ( "ExportGroup %s (%s) update volume HLU: %s -> %s" , exportGroup . getLabel ( ) , exportGroup . getId ( ) , volumeURI , hlu ) ) ; exportGroup . addVolume ( volumeURI , Integer . valueOf ( hlu ) ) ; volumeIter . remove ( ) ; } } } } } }
examine exportgroup ' s volumes to find any that do not have their hlu filled in . in case it is not filled , the exportmasks will be searched to find an hlu to assign for the volume . note : exportgroup is not persisted here .
