[jboss-dev-forums] [Design of Clustering on JBoss (Clusters/JBoss)] - Re: JBAS-4919 - ha singletons in heterogenous topologies

galder.zamarreno@jboss.com do-not-reply at jboss.com
Fri Jan 18 16:31:23 EST 2008


I've switched to pickSingleton(List) and managed to get the singleton election tests running successfully again. A few notes/questions:

1.- I could do with having a method in DRM like this:
public List<ClusterNode> lookupReplicantsNodes(String key);
And deprecate lookupReplicantsNodeNames() as it returns a List of String names, which could still be accessible via ClusterNode.getName().

Otherwise, building the List is inefficient. I have to take the singleton name, look up the List of Cluster Node names, and with that list, take ClusterNode list from the partition and match them to create a brand new ClusterNode list with the nodes where the singleton are running. ugh

2.- The code did not inject the ha partition and singleton name into the election policy. I have done this by overriding HASingletonSupport.startService() and assign before super.startService(). I have my doubts whether this is the best place to do this, so feel free to flame me:

@Override
  | protected void startService() throws Exception
  | {
  |    if (mElectionPolicyMB != null)
  |    {
  |       mElectionPolicyMB.setHAPartition(getHAPartition());
  |       mElectionPolicyMB.setSingletonName(getServiceHAName());
  |     }
  |     
  |     super.startService();
  | }

3.- HASingletonSupport does not have access to the singleton object, but we could override startService in HASC again and do something like:

@Override
  | protected void startService() throws Exception
  | {
  |    if (getElectionPolicy() != null)
  |    {
  |       getElectionPolicy.setSingletonObject(mSingleton);
  |    }
  |       
  |    super.startService();
  | }

4.- TODO: Might be worth creating a test with 3 cluster nodes and have a singleton deployed in two. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121436#4121436

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121436



More information about the jboss-dev-forums mailing list