Package hudson.model
Class Queue.Saver
- java.lang.Object
-
- hudson.model.queue.QueueListener
-
- hudson.model.Queue.Saver
-
- All Implemented Interfaces:
ExtensionPoint
,Runnable
- Enclosing class:
- Queue
@Extension @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final class Queue.Saver extends QueueListener implements Runnable
ScheduleQueue.save()
call for near future once items change. Ignore all changes until the time the save takes place. Once queue is restored after a crash, items stages might not be accurate until the next #maintain() - this is not a problem as the items will be reshuffled first and then scheduled during the next maintainance cycle. Implementation note: Queue.load() calls QueueListener hooks for every item deserialized that can hammer the persistance on load. The problem is avoided by delaying the actual save for the time long enough for queue to load so the save operations will collapse into one. Also, items are persisted as buildable or blocked in vast majority of cases and those stages does not trigger the save here.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description Saver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onEnterWaiting(Queue.WaitingItem wi)
When a task is submitted to the queue, it first gets to the waiting phase, where it spends until the quiet period runs out and the item becomes executable.void
onLeft(Queue.LeftItem li)
The item has left the queue, either by gettingcancelled
or by getting picked up by an executor and starts running.void
run()
-
Methods inherited from class hudson.model.queue.QueueListener
all, onEnterBlocked, onEnterBuildable, onLeaveBlocked, onLeaveBuildable, onLeaveWaiting
-
-
-
-
Method Detail
-
onEnterWaiting
public void onEnterWaiting(Queue.WaitingItem wi)
Description copied from class:QueueListener
When a task is submitted to the queue, it first gets to the waiting phase, where it spends until the quiet period runs out and the item becomes executable.- Overrides:
onEnterWaiting
in classQueueListener
- See Also:
Queue.WaitingItem.timestamp
-
onLeft
public void onLeft(Queue.LeftItem li)
Description copied from class:QueueListener
The item has left the queue, either by gettingcancelled
or by getting picked up by an executor and starts running.- Overrides:
onLeft
in classQueueListener
-
-