Source:
<code>public void performHaResevationCheck() { log.debug("HA Reservation check timer entered."); List<VDSGroup> clusters = DbFacade.getInstance().getVdsGroupDao().getAll(); if (clusters != null) { HaReservationHandling haReservationHandling = new HaReservationHandling(); for (VDSGroup cluster : clusters) { if (cluster.supportsHaReservation()) { List<VDS> returnedFailedHosts = new ArrayList<VDS>(); boolean status = haReservationHandling.checkHaReservationStatusForCluster(cluster, returnedFailedHosts); if (!status) { AuditLogableBase logable = new AuditLogableBase(); logable.setVdsGroupId(cluster.getId()); logable.addCustomValue("ClusterName", cluster.getName()); String failedHostsStr = StringUtils.join(Entities.objectNames(returnedFailedHosts), ", "); logable.addCustomValue("Hosts", failedHostsStr); AlertDirector.Alert(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION); log.infoFormat("Cluster: {0} fail to pass HA reservation check.", cluster.getName()); } <START> boolean oldStatus = <END> clusterId2isHaReservationSafe.containsKey(cluster.getId()) ? clusterId2isHaReservationSafe.get(cluster.getId()) : true; clusterId2isHaReservationSafe.put(cluster.getId(), status); if (!oldStatus && status) { AuditLogableBase logable = new AuditLogableBase(); logable.setVdsGroupId(cluster.getId()); logable.addCustomValue("ClusterName", cluster.getName()); AlertDirector.Alert(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION_DOWN); log.infoFormat("Cluster: {0} pass HA reservation check.", cluster.getName()); } } } } log.debug("HA Reservation check timer finished."); }</code><technical_language>status/oldStatus a clearer name</technical_language>

Target:
public void performHaResevationCheck() { log.debug("HA Reservation check timer entered."); List<VDSGroup> clusters = DbFacade.getInstance().getVdsGroupDao().getAll(); if (clusters != null) { HaReservationHandling haReservationHandling = new HaReservationHandling(); for (VDSGroup cluster : clusters) { if (cluster.supportsHaReservation()) { List<VDS> returnedFailedHosts = new ArrayList<VDS>(); boolean clusterHaStatus = haReservationHandling.checkHaReservationStatusForCluster(cluster, returnedFailedHosts); if (!clusterHaStatus) { AuditLogableBase logable = new AuditLogableBase(); logable.setVdsGroupId(cluster.getId()); logable.addCustomValue("ClusterName", cluster.getName()); String failedHostsStr = StringUtils.join(Entities.objectNames(returnedFailedHosts), ", "); logable.addCustomValue("Hosts", failedHostsStr); AlertDirector.Alert(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION); log.infoFormat("Cluster: {0} fail to pass HA reservation check.", cluster.getName()); } boolean clusterHaStatusFromPreviousCycle = clusterId2isHaReservationSafe.containsKey(cluster.getId()) ? clusterId2isHaReservationSafe.get(cluster.getId()) : true; clusterId2isHaReservationSafe.put(cluster.getId(), clusterHaStatus); if (!clusterHaStatusFromPreviousCycle && clusterHaStatus) { AuditLogableBase logable = new AuditLogableBase(); logable.setVdsGroupId(cluster.getId()); logable.addCustomValue("ClusterName", cluster.getName()); AlertDirector.Alert(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION_DOWN); } } } } log.debug("HA Reservation check timer finished."); }