public abstract class QueueSorter extends Object implements ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
static Comparator<Queue.BlockedItem> |
DEFAULT_BLOCKED_ITEM_COMPARATOR
A comparator that sorts
Queue.BlockedItem instances based on how long they have been in the queue. |
Constructor and Description |
---|
QueueSorter() |
Modifier and Type | Method and Description |
---|---|
static ExtensionList<QueueSorter> |
all()
All registered
QueueSorter 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.
|
public static final Comparator<Queue.BlockedItem> DEFAULT_BLOCKED_ITEM_COMPARATOR
Queue.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)public abstract void sortBuildableItems(List<Queue.BuildableItem> buildables)
buildables
- List of buildable items in the queue. Never null.public void sortBlockedItems(List<Queue.BlockedItem> blockedItems)
blockedItems
- List of blocked items in the queue. Never null.public static ExtensionList<QueueSorter> all()
QueueSorter
s. Only the first one will be picked up,
unless explicitly overridden by Queue.setSorter(QueueSorter)
.@Initializer(after=JOB_LOADED) public static void installDefaultQueueSorter()
Queue.Queue(LoadBalancer)
is too early to do thisCopyright © 2018. All rights reserved.