org.objectweb.proactive.loadbalancing
Class LoadBalancer

java.lang.Object
  extended by 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

Field Summary
protected  java.lang.String balancerName
           
protected  InformationRecover informationRecover
           
protected  LoadMonitor lm
           
protected  java.util.ArrayList<LoadBalancer> loadBalancers
           
static org.apache.log4j.Logger logger
           
protected  Metric metric
           
protected  Node myNode
           
protected  LoadBalancer myThis
           
protected  java.util.Random randomizer
           
 
Constructor Summary
LoadBalancer()
           
LoadBalancer(MetricFactory mf)
           
 
Method Summary
 void addNewBalancer(LoadBalancer lb)
           
protected  void getActiveObjectsFrom(LoadBalancer remoteBalancer, double remoteRanking)
           
 java.lang.String getName()
           
 void init(java.util.ArrayList<LoadBalancer> loadBalancers, InformationRecover ir)
           
 void notifyLoadBalancers()
           
 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.
 void sendActiveObjectsTo(Node remoteNode, double remoteRanking)
           
 void startBalancing()
           
 void stealWork()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

LoadBalancer

public LoadBalancer()

LoadBalancer

public LoadBalancer(MetricFactory mf)
Method Detail

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.