Class FQBaseStrategy
- java.lang.Object
-
- jenkins.advancedqueue.sorter.SorterStrategy
-
- jenkins.advancedqueue.sorter.strategy.MultiBucketStrategy
-
- jenkins.advancedqueue.sorter.strategy.FQBaseStrategy
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<SorterStrategy>
- Direct Known Subclasses:
FQStrategy
,WFQStrategy
public abstract class FQBaseStrategy extends MultiBucketStrategy
Scheduler based on Fair Queuing algorithm.- Since:
- 2.0
- Author:
- Magnus Sandberg
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jenkins.advancedqueue.sorter.strategy.MultiBucketStrategy
MultiBucketStrategy.MultiBucketStrategyDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description protected static float
MIN_STEP_SIZE
-
Fields inherited from class jenkins.advancedqueue.sorter.strategy.MultiBucketStrategy
DEFAULT_PRIORITIES_NUMBER, DEFAULT_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description FQBaseStrategy()
FQBaseStrategy(int numberOfPriorities, int defaultPriority)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected float
getMinimumWeightToAssign(int priority)
protected float
getWeightToUse(int priority, float minimumWeightToAssign)
SorterStrategyCallback
onNewItem(Queue.Item item, SorterStrategyCallback weightCallback)
Called when a newItem
enters the queue.void
onStartedItem(Queue.LeftItem item, float weight)
Called when aItem
leaves the queue and it is started.-
Methods inherited from class jenkins.advancedqueue.sorter.strategy.MultiBucketStrategy
doFillDefaultPriorityItems, getDefaultPriority, getNumberOfPriorities
-
Methods inherited from class jenkins.advancedqueue.sorter.SorterStrategy
all, getAllSorterStrategies, getDescriptor, getPrioritySorterStrategy, getSorterStrategy, onCanceledItem
-
-
-
-
Field Detail
-
MIN_STEP_SIZE
protected static final float MIN_STEP_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
onStartedItem
public void onStartedItem(Queue.LeftItem item, float weight)
Description copied from class:SorterStrategy
Called when aItem
leaves the queue and it is started.- Overrides:
onStartedItem
in classSorterStrategy
- Parameters:
item
- theQueue.LeftItem
weight
- the weight assigned when the item entered the queue
-
onNewItem
public SorterStrategyCallback onNewItem(Queue.Item item, SorterStrategyCallback weightCallback)
Description copied from class:SorterStrategy
Called when a newItem
enters the queue.- Specified by:
onNewItem
in classSorterStrategy
- Parameters:
item
- theQueue.WaitingItem
orBuildableItem
that enters the queueweightCallback
- the callback holds the priority to use anded the called method must set the weight before returning- Returns:
- the
SorterStrategyCallback
provided to the call must be returned
-
getMinimumWeightToAssign
protected float getMinimumWeightToAssign(int priority)
-
getWeightToUse
protected float getWeightToUse(int priority, float minimumWeightToAssign)
-
-