Package hudson.model.queue
Class QueueSorter
java.lang.Object
hudson.model.queue.QueueSorter
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
AbstractQueueSorterImpl
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
Modifier and TypeFieldDescriptionstatic final Comparator<Queue.BlockedItem>
A comparator that sortsQueue.BlockedItem
instances based on how long they have been in the queue. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<QueueSorter>
all()
All registeredQueueSorter
s.static void
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 Details
-
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
-
-
Constructor Details
-
QueueSorter
public QueueSorter()
-
-
Method Details
-
sortBuildableItems
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
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
All registeredQueueSorter
s. Only the first one will be picked up, unless explicitly overridden byQueue.setSorter(QueueSorter)
. -
installDefaultQueueSorter
Installs the default queue sorter.Queue(LoadBalancer)
is too early to do this
-