Openwings API Documentation (v1.0)

net.openwings.container.utilities
Interface LoadBalancer


public interface LoadBalancer

This interface describes a plug-in that makes load balancing decisions for a container manager. The Container Manager core uses a LoadBalancer plugin to assign new processes to containers and to decide which processes to move between containers. The Container Manager passes information about some or all of its containers, and all of the MobileProcess in each of these containers.

Since:
0.9.1

Method Summary
 UniqueID assignProcess(ComponentDescriptor descriptor, LoadBalancerContainerInfo[] containerInfoList)
          This method allocates a process to a container.
 LoadBalancerAssignment[] balanceLoad(LoadBalancerContainerInfo[] containerInfoList)
          This method generates instructions for balancing the load between containers.
 

Method Detail

assignProcess

public UniqueID assignProcess(ComponentDescriptor descriptor,
                              LoadBalancerContainerInfo[] containerInfoList)
This method allocates a process to a container.

Parameters:
descriptor - process to be allocated
Returns:
unique identifier for the container chosen, or null if the existing containers are too full. In this case the ContainerManager should start a new container.

balanceLoad

public LoadBalancerAssignment[] balanceLoad(LoadBalancerContainerInfo[] containerInfoList)
This method generates instructions for balancing the load between containers. The Container Manager will probably call this method at regular intervals, upon receiving new PerformanceReports for a container or process, or some combination of the above.

Returns:
array of assignments indicating which processes to move to which containers. The processes and containers are represented by unique identifiers. The array should not contain multiple assignments for the same process.

Openwings API Documentation (v1.0)