org.bstick12.jenkinsci.plugins.leastload
Class LeastLoadBalancer

java.lang.Object
  extended by hudson.model.LoadBalancer
      extended by org.bstick12.jenkinsci.plugins.leastload.LeastLoadBalancer

public class LeastLoadBalancer
extends hudson.model.LoadBalancer

A LoadBalancer implementation that the leastload plugin uses to replace the default Jenkins LoadBalancer

The LeastLoadBalancer chooses Executors that have the least load. An Executor is defined as having the least load if it is idle or has the most available Executors

If for any reason we are unsuccessful in creating a MappingWorksheet.Mapping we fall back on the default Jenkins LoadBalancer.CONSISTENT_HASH and try to use that.

Author:
brendan.nolan@gmail.com

Nested Class Summary
protected static class LeastLoadBalancer.ExecutorChunkComparator
           
 
Field Summary
 
Fields inherited from class hudson.model.LoadBalancer
CONSISTENT_HASH, DEFAULT
 
Constructor Summary
LeastLoadBalancer(hudson.model.LoadBalancer fallback)
          Create the LeastLoadBalancer with a fallback that will be used in case of any failures.
 
Method Summary
 hudson.model.LoadBalancer getFallBackLoadBalancer()
          Retrieves the fallback LoadBalancer
 hudson.model.queue.MappingWorksheet.Mapping map(hudson.model.Queue.Task task, hudson.model.queue.MappingWorksheet ws)
           
 
Methods inherited from class hudson.model.LoadBalancer
sanitize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeastLoadBalancer

public LeastLoadBalancer(hudson.model.LoadBalancer fallback)
Create the LeastLoadBalancer with a fallback that will be used in case of any failures.

Method Detail

map

public hudson.model.queue.MappingWorksheet.Mapping map(hudson.model.Queue.Task task,
                                                       hudson.model.queue.MappingWorksheet ws)
Specified by:
map in class hudson.model.LoadBalancer

getFallBackLoadBalancer

public hudson.model.LoadBalancer getFallBackLoadBalancer()
Retrieves the fallback LoadBalancer

Returns:


Copyright © 2004-2013. All Rights Reserved.