Class LeastLoadBalancer
- java.lang.Object
-
- hudson.model.LoadBalancer
-
- org.bstick12.jenkinsci.plugins.leastload.LeastLoadBalancer
-
- All Implemented Interfaces:
ExtensionPoint
public class LeastLoadBalancer extends LoadBalancer
ALoadBalancer
implementation that the leastload plugin uses to replace the default JenkinsLoadBalancer
The
LeastLoadBalancer
choosesExecutor
s that have the least load. AnExecutor
is defined as having the least load if it is idle or has the most availableExecutor
sIf for any reason we are unsuccessful in creating a
MappingWorksheet.Mapping
we fall back on the default JenkinsLoadBalancer.CONSISTENT_HASH
and try to use that.- Author:
- brendan.nolan@gmail.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
LeastLoadBalancer.ExecutorChunkComparator
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.LoadBalancer
CONSISTENT_HASH, DEFAULT
-
-
Constructor Summary
Constructors Constructor Description LeastLoadBalancer(LoadBalancer fallback)
Create theLeastLoadBalancer
with a fallback that will be used in case of any failures.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LoadBalancer
getFallBackLoadBalancer()
Retrieves the fallbackLoadBalancer
MappingWorksheet.Mapping
map(Queue.Task task, MappingWorksheet ws)
-
Methods inherited from class hudson.model.LoadBalancer
sanitize
-
-
-
-
Constructor Detail
-
LeastLoadBalancer
public LeastLoadBalancer(LoadBalancer fallback)
Create theLeastLoadBalancer
with a fallback that will be used in case of any failures.- Parameters:
fallback
- TheLoadBalancer
fallback to use in case of failure
-
-
Method Detail
-
map
public MappingWorksheet.Mapping map(Queue.Task task, MappingWorksheet ws)
- Specified by:
map
in classLoadBalancer
-
getFallBackLoadBalancer
public LoadBalancer getFallBackLoadBalancer()
Retrieves the fallbackLoadBalancer
- Returns:
- - fallback
LoadBalancer
-
-