Class FifoExecutableOrderProvider
java.lang.Object
com.atlassian.bamboo.v2.build.queue.order.FifoExecutableOrderProvider
- All Implemented Interfaces:
ExecutableOrderProvider
Basic order provider that implements a reorderable FIFO ordering.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable ResultKey
findExecutableForAgent
(long agentId, @NotNull Collection<QueueOfExecutables.ExecutableData> executableData) From the list of executables, returns the executable that should be picked up by the agent.@NotNull Collection<BuildQueueManager.QueuedResultKey>
Returns a full list of result keys of queued executables ordered with a global ordering.void
onDequeue
(@NotNull CommonContext context) Called when a context is removed from queue.void
onEnqueue
(@NotNull Iterable<CommonContext> contexts) Will not be called concurrently.void
removeByKey
(ResultKey resultKey) Remove items with aResultKey
.boolean
Called when an executable with a specific result key should be moved to a specific index in the queue.
-
Constructor Details
-
FifoExecutableOrderProvider
public FifoExecutableOrderProvider()
-
-
Method Details
-
onEnqueue
Description copied from interface:ExecutableOrderProvider
Will not be called concurrently. Called when new context are added to the queue.- Specified by:
onEnqueue
in interfaceExecutableOrderProvider
-
onDequeue
Description copied from interface:ExecutableOrderProvider
Called when a context is removed from queue. It may be manually removed from queue (stopped), or sent to and acknowledged by an agent. Will not be called concurrently.- Specified by:
onDequeue
in interfaceExecutableOrderProvider
-
findExecutableForAgent
@Nullable public @Nullable ResultKey findExecutableForAgent(long agentId, @NotNull @NotNull Collection<QueueOfExecutables.ExecutableData> executableData) Description copied from interface:ExecutableOrderProvider
From the list of executables, returns the executable that should be picked up by the agent. Returns null when there none of the supplied executables is suitable.- Specified by:
findExecutableForAgent
in interfaceExecutableOrderProvider
-
getOrderedExecutables
Description copied from interface:ExecutableOrderProvider
Returns a full list of result keys of queued executables ordered with a global ordering.- Specified by:
getOrderedExecutables
in interfaceExecutableOrderProvider
- Returns:
- the returned iterable has to be thread safe.
-
reorder
Description copied from interface:ExecutableOrderProvider
Called when an executable with a specific result key should be moved to a specific index in the queue. Can be ignored. Has to be thread safe, will not be mutexed with enq/deq.- Specified by:
reorder
in interfaceExecutableOrderProvider
- Returns:
- true if the executable has successfully been moved, false otherwise.
-
removeByKey
Description copied from interface:ExecutableOrderProvider
Remove items with aResultKey
. Called if Bamboo detects that order provider contains references to items that are no longer accessible.- Specified by:
removeByKey
in interfaceExecutableOrderProvider
-