- All Implemented Interfaces:
public abstract class LoadBalancer extends Object implements ExtensionPointStrategy that decides which
Queue.Taskgets run on which
- Kohsuke Kawaguchi
Constructors Constructor Description
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description
map(Queue.Task task, MappingWorksheet worksheet)Chooses the executor(s) to carry out the build for the given task.
LoadBalancerinto a decorator that tests the basic sanity of the implementation.
public static final LoadBalancer CONSISTENT_HASHUses a consistent hash for scheduling.
@CheckForNull public abstract MappingWorksheet.Mapping map(@NonNull Queue.Task task, MappingWorksheet worksheet)Chooses the executor(s) to carry out the build for the given task.
This method is invoked from different threads, but the execution is serialized by the caller. The thread that invokes this method always holds a lock to
Queue, so queue contents can be safely introspected from this method, if that information is necessary to make decisions.
task- The task whose execution is being considered. Never null.
worksheet- The work sheet that represents the matching that needs to be made. The job of this method is to determine which work units on this worksheet are executed on which executors (also on this worksheet.)
- Build up the mapping by using the given worksheet and return it. Return null if you don't want the task to be executed right now, in which case this method will be called some time later with the same task.