-
1. Re: Extracting load balancing classes from AS cluster module
tom.elrod Aug 21, 2006 1:43 PM (in response to brian.stansberry)1. Agree with removing the HARMIClient.
2. FamilyClusterInfo looks fine with me to use within remoting. There are a few methods that I don't really understand what they do, such as:
public int getCursor();
public int setCursor (int cursor);
public Object getObject ();
public Object setObject (Object whatever);
(org.jboss.ha.framework.interfaces.FamilyClusterInfoImpl sheds no light on them really as they are not used for anything other than the toString()).
3. Would prefer to not have the:
public Object chooseTarget (FamilyClusterInfo clusterFamily, Invocation routingDecision);
in the root interface.
Overall, would like to have a base LoadBalancePolicy interface with just:
public Object chooseTarget (FamilyClusterInfo clusterFamily);
and then have a JBossAS specific one that extends that. Only problem is that everyone is already using the current LoadBalancePolicy, so could create another base interface the the current one extends that just has the one chooseTarget() method. Don't really know what to name it, but seems like might be the easiest approach.
Although jndi will use remoting at some point and deteached invokers will fall under remoting project at some point, don't want to factor that in too much right now as don't know when this will happen or what the impact will be. -
2. Re: Extracting load balancing classes from AS cluster module
brian.stansberry Aug 21, 2006 2:37 PM (in response to brian.stansberry)"tom.elrod@jboss.com" wrote:
2. FamilyClusterInfo looks fine with me to use within remoting. There are a few methods that I don't really understand what they do, such as:
public int getCursor();
public int setCursor (int cursor);
public Object getObject ();
public Object setObject (Object whatever);
These are used by the load balance policies. A load balance policy instance will get created with every proxy download, while the FCI instance for the family gets created on the 1st download and thereafter remains the same. So, the FCI is the natural location to store state that multiple proxies for the same family use.
cursor -- used by RoundRobin to store the index of the current target.
object -- used by FirstAvailableIdenticalAllProxies to store the current target.Overall, would like to have a base LoadBalancePolicy interface with just:
public Object chooseTarget (FamilyClusterInfo clusterFamily);
and then have a JBossAS specific one that extends that. Only problem is that everyone is already using the current LoadBalancePolicy, so could create another base interface the the current one extends that just has the one chooseTarget() method. Don't really know what to name it, but seems like might be the easiest approach.
+1.
We can probably just call it LoadBalancePolicy and namespace it with a different package.Although jndi will use remoting at some point and deteached invokers will fall under remoting project at some point, don't want to factor that in too much right now as don't know when this will happen or what the impact will be.
OK, for now the stuff necessary to support the legacy code will remain in AS. Even if/when the detached invoker stuff shifts to Remoting you'd probably want to package that separately, so there'll probably still be a base interface and an extended one. -
3. Re: Extracting load balancing classes from AS cluster module
tom.elrod Aug 22, 2006 1:03 PM (in response to brian.stansberry)Roger. Thanks.
-
4. Re: Extracting load balancing classes from AS cluster module
brian.stansberry Sep 12, 2006 5:08 PM (in response to brian.stansberry)With the effort underway to consolidate the client side interceptor models (see http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970879#3970879), need to revisit a bit the LoadBalancePolicy interface.
We'd decided earlier to create a simple base interface with only chooseTarget(FamilyClusterInfo fci) and then to leave a legacy subinterface with a method that took o.j.invocation.Invocation as a param.
If we're going to consolidate to a single interceptor model, this raises a few questions:
1) Will we get rid of the subinterface w/ o.j.invocation.Invocation? (An indirect way of asking whether we'll get rid of the old interceptor model for 5.0, or leave it around for ease of migration.)
2) Will we want a method chooseTarget(FamilyClusterInfo, o.j.aop.joinpoint.Invocation) ? This will provide an API similar to the old detached invoker model that any custom policies that people wrote can adapt to.
3) If yes to #1 and #2, in the base interface or a subinterface?
4) Another possibility Tom and I discussed is to create an abstraction of the data that would be passed in the Invocation and pass that to the LoadBalancePolicy, thus reducing the coupling to the invocation type. -
5. Re: Extracting load balancing classes from AS cluster module
starksm64 Sep 13, 2006 6:12 PM (in response to brian.stansberry)1) We have to drop the old interceptor/invocation if we are going to be able to unify and resuse aspects.
2-4) LoadBalancePolicy should ideally just have an abstraction of the invocation payload and metadata as that is all that it would use rather than a dependency on the org.jboss.aop.joinpoint.Invocation. I thought we were breaking out the metadata from the Invocation, but its still there. Still, I would just have chooseTarget(FamilyClusterInfo, Map) and if a policy needs the Invocation it can be added by interceptor.