Source:
private void updateExistingAndNewVolumes(Guid clusterId, Map<Guid, GlusterVolumeEntity> volumesMap) { VDSGroup cluster = getClusterDao().get(clusterId); for (Entry<Guid, GlusterVolumeEntity> entry : volumesMap.entrySet()) { GlusterVolumeEntity volume = entry.getValue(); log.debug("Analyzing volume '{}'", volume.getName()); GlusterVolumeEntity existingVolume = getVolumeDao().getById(entry.getKey()); if (existingVolume == null) { try { createVolume(volume); } catch (Exception e) { log.error("Could not save volume in database: {}", volume.getName(), e.getMessage()); log.debug("Exception", e); } if (getGlusterUtil().isGlusterSnapshotSupported(cluster.getCompatibilityVersion(), clusterId) && cluster.isGlusterCliBasedSchedulingOn() && (Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)).equalsIgnoreCase(volume.getName())) { VdcReturnValueBase returnValue = getBackend().runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new GlusterVolumeActionParameters(volume.getId(), false), ExecutionHandler.createInternalJobContext()); if (!returnValue.getSucceeded()) { log.warn("Unbale to set volume snapshot scheduling flag to gluster CLI scheduler"); } else { logUtil.logVolumeMessage(volume, AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLED); } } } else { try { log.debug("Volume '{}' exists in engine. Checking if it needs to be updated.", existingVolume.getName()); updateVolume(existingVolume, volume); } catch (Exception e) { log.error("Error while updating volume '{}': {}", volume.getName(), e.getMessage()); log.debug("Exception", e); } } } }

Target:
private void updateExistingAndNewVolumes(Guid clusterId, Map<Guid, GlusterVolumeEntity> volumesMap) { VDSGroup cluster = getClusterDao().get(clusterId); for (Entry<Guid, GlusterVolumeEntity> entry : volumesMap.entrySet()) { GlusterVolumeEntity volume = entry.getValue(); log.debug("Analyzing volume '{}'", volume.getName()); GlusterVolumeEntity existingVolume = getVolumeDao().getById(entry.getKey()); if (existingVolume == null) { try { createVolume(volume); } catch (Exception e) { log.error("Could not save volume in database: {}", volume.getName(), e.getMessage()); log.debug("Exception", e); } if (getGlusterUtil().isGlusterSnapshotSupported(cluster.getCompatibilityVersion(), clusterId) && cluster.isGlusterCliBasedSchedulingOn() && (Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)).equalsIgnoreCase(volume.getName())) { VdcReturnValueBase returnValue = backend.runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new GlusterVolumeActionParameters(volume.getId(), false), ExecutionHandler.createInternalJobContext()); if (!returnValue.getSucceeded()) { log.warn("Unbale to set volume snapshot scheduling flag to gluster CLI scheduler on cluster {}", cluster.getName()); } else { logUtil.logVolumeMessage(volume, AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLED); } } } else { try { log.debug("Volume '{}' exists in engine. Checking if it needs to be updated.", existingVolume.getName()); updateVolume(existingVolume, volume); } catch (Exception e) { log.error("Error while updating volume '{}': {}", volume.getName(), e.getMessage()); log.debug("Exception", e); } } } }