Author: pferraro
Date: 2008-10-03 07:19:02 -0400 (Fri, 03 Oct 2008)
New Revision: 1933
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ModClusterService.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java
Log:
Update drm entry states instead of creating new one.
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/ModClusterService.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/ModClusterService.java 2008-10-03
10:39:58 UTC (rev 1932)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/ModClusterService.java 2008-10-03
11:19:02 UTC (rev 1933)
@@ -454,6 +454,11 @@
}
}
+ void updateLocalDRMEntry()
+ {
+ this.updateLocalDRM(this.drmEntry);
+ }
+
void updateLocalDRM(ModClusterServiceDRMEntry ourNewStatus)
{
try
@@ -555,11 +560,13 @@
DistributedReplicantManager drm =
partition.getDistributedReplicantManager();
String key = this.coord.getHAServiceKey();
ModClusterServiceDRMEntry oldStatus = (ModClusterServiceDRMEntry)
drm.lookupLocalReplicant(key);
- if (newStatus.equals(oldStatus) == false)
+ if (!newStatus.equals(oldStatus))
{
try
{
- drm.add(key, new ModClusterServiceDRMEntry(cn,
newStatus.getMCMPServerStates()));
+ oldStatus.setMCMPServerStates(newStatus.getMCMPServerStates());
+ drm.add(key, oldStatus);
+// drm.add(key, new ModClusterServiceDRMEntry(cn,
newStatus.getMCMPServerStates()));
}
catch (Exception e)
{
@@ -901,8 +908,10 @@
ClusterNode node = partition.getClusterNode();
boolean othersFirst =
this.coord.narrowCandidateList(allStatuses).contains(node);
- ModClusterServiceDRMEntry ourNewStatus = new ModClusterServiceDRMEntry(node,
masterList);
- boolean updated = !ourNewStatus.equals(ourCurrentStatus);
+ Set<MCMPServerState> oldStates =
this.coord.drmEntry.getMCMPServerStates();
+ boolean updated = !oldStates.equals(masterList);
+// ModClusterServiceDRMEntry ourNewStatus = new ModClusterServiceDRMEntry(node,
masterList);
+// boolean updated = !ourNewStatus.equals(ourCurrentStatus);
if (othersFirst)
{
@@ -910,14 +919,18 @@
if (updated)
{
- this.coord.updateLocalDRM(ourNewStatus);
+ this.coord.drmEntry.setMCMPServerStates(masterList);
+ this.coord.updateLocalDRMEntry();
+// this.coord.updateLocalDRM(ourNewStatus);
}
}
else
{
if (updated)
{
- this.coord.updateLocalDRM(ourNewStatus);
+ this.coord.drmEntry.setMCMPServerStates(masterList);
+ this.coord.updateLocalDRMEntry();
+// this.coord.updateLocalDRM(ourNewStatus);
}
this.coord.clusterStatusComplete(statuses);
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java 2008-10-03
10:39:58 UTC (rev 1932)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java 2008-10-03
11:19:02 UTC (rev 1933)
@@ -41,7 +41,7 @@
private static final long serialVersionUID = 8275232749243297786L;
private final ClusterNode peer;
- private final Set<MCMPServerState> mcmpServerStates;
+ private volatile Set<MCMPServerState> mcmpServerStates;
private final Integer healthyEstablishedCount;
private final Integer establishedCount;
private final Integer healthyCount;
@@ -92,6 +92,11 @@
return this.peer;
}
+ public void setMCMPServerStates(Set<MCMPServerState> states)
+ {
+ this.mcmpServerStates = states;
+ }
+
public Set<MCMPServerState> getMCMPServerStates()
{
return this.mcmpServerStates;
Show replies by date