org.objectweb.proactive.loadbalancing
Class LoadBalancer
java.lang.Object
org.objectweb.proactive.loadbalancing.LoadBalancer
- All Implemented Interfaces:
- ProActiveInternalObject
- Direct Known Subclasses:
- P2PLoadBalancer
public class LoadBalancer
- extends java.lang.Object
- implements ProActiveInternalObject
This is the main class for load balancing algorithms, all implementations should inherite
from this one. It provides the methods for register the load (used by the load monitor)
and to send active objects to another node, choosing the one with the shortest queue.
The load balance for Active Objects is server initiated: overloaded machines has to begin
the balance process. Using this paradigm, particular implementations of Load Balancing algorithms
have to implement only the method startBalancing.
Also, this class provides a method to know if this CPU is in underloaded state
(usefull in server oriented load balancing algorithms).
- Author:
- Javier.Bustos@sophia.inria.fr
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
public static org.apache.log4j.Logger logger
lm
protected LoadMonitor lm
metric
protected Metric metric
myNode
protected Node myNode
loadBalancers
protected java.util.ArrayList<LoadBalancer> loadBalancers
balancerName
protected java.lang.String balancerName
randomizer
protected java.util.Random randomizer
myThis
protected LoadBalancer myThis
informationRecover
protected InformationRecover informationRecover
LoadBalancer
public LoadBalancer()
LoadBalancer
public LoadBalancer(MetricFactory mf)
startBalancing
public void startBalancing()
stealWork
public void stealWork()
sendActiveObjectsTo
public void sendActiveObjectsTo(Node remoteNode,
double remoteRanking)
getActiveObjectsFrom
protected void getActiveObjectsFrom(LoadBalancer remoteBalancer,
double remoteRanking)
sendActiveObjectsTo
public void sendActiveObjectsTo(Node destNode)
- This method sends an active object to a destiny, choosing the active objects
whom don't implement
ProActiveInternalObject
and having the shortest queue.
- Parameters:
destNode
- Node destiny to send the active abject.
If this node is local, this method does nothing.
getName
public java.lang.String getName()
init
public void init(java.util.ArrayList<LoadBalancer> loadBalancers,
InformationRecover ir)
notifyLoadBalancers
public void notifyLoadBalancers()
addNewBalancer
public void addNewBalancer(LoadBalancer lb)
Copyright 2001-2007 INRIA All Rights Reserved.