Class QueueSorter

    • Field Detail

      • DEFAULT_BLOCKED_ITEM_COMPARATOR

        public static final Comparator<Queue.BlockedItem> DEFAULT_BLOCKED_ITEM_COMPARATOR
        A comparator that sorts 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)
        Since:
        1.618
    • Constructor Detail

      • QueueSorter

        public QueueSorter()
    • 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