Package hudson.model.queue
Class QueueSorter
- java.lang.Object
-
- hudson.model.queue.QueueSorter
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
AbstractQueueSorterImpl
public abstract class QueueSorter extends Object implements ExtensionPoint
Singleton extension point for sorting buildable items- Since:
- 1.343
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Queue.BlockedItem>
DEFAULT_BLOCKED_ITEM_COMPARATOR
A comparator that sortsQueue.BlockedItem
instances based on how long they have been in the queue.
-
Constructor Summary
Constructors Constructor Description QueueSorter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<QueueSorter>
all()
All registeredQueueSorter
s.static void
installDefaultQueueSorter()
Installs the default queue sorter.void
sortBlockedItems(List<Queue.BlockedItem> blockedItems)
Sorts the blocked items list.abstract void
sortBuildableItems(List<Queue.BuildableItem> buildables)
Sorts the buildable items list.
-
-
-
Field Detail
-
DEFAULT_BLOCKED_ITEM_COMPARATOR
public static final Comparator<Queue.BlockedItem> DEFAULT_BLOCKED_ITEM_COMPARATOR
A comparator that sortsQueue.BlockedItem
instances based on how long they have been in the queue. (We want the time since in queue by default as blocking on upstream/downstream considers waiting items also and thus the blocking starts once the task is in the queue not once the task is buildable)- Since:
- 1.618
-
-
Method Detail
-
sortBuildableItems
public abstract void sortBuildableItems(List<Queue.BuildableItem> buildables)
Sorts the buildable items list. The items at the beginning will be executed before the items at the end of the list.- Parameters:
buildables
- List of buildable items in the queue. Never null.
-
sortBlockedItems
public void sortBlockedItems(List<Queue.BlockedItem> blockedItems)
Sorts the blocked items list. The items at the beginning will be considered for removal from the blocked state before the items at the end of the list.- Parameters:
blockedItems
- List of blocked items in the queue. Never null.- Since:
- 1.618
-
all
public static ExtensionList<QueueSorter> all()
All registeredQueueSorter
s. Only the first one will be picked up, unless explicitly overridden byQueue.setSorter(QueueSorter)
.
-
installDefaultQueueSorter
@Initializer(after=JOB_CONFIG_ADAPTED) public static void installDefaultQueueSorter()
Installs the default queue sorter.Queue(LoadBalancer)
is too early to do this
-
-