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
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable ResultKeyfindExecutableForAgent(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.voidonDequeue(@NotNull CommonContext context) Called when a context is removed from queue.voidonEnqueue(@NotNull Iterable<CommonContext> contexts) Will not be called concurrently.voidremoveByKey(ResultKey resultKey) Remove items with aResultKey.booleanCalled 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:ExecutableOrderProviderWill not be called concurrently. Called when new context are added to the queue.- Specified by:
onEnqueuein interfaceExecutableOrderProvider
-
onDequeue
Description copied from interface:ExecutableOrderProviderCalled 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:
onDequeuein interfaceExecutableOrderProvider
-
findExecutableForAgent
@Nullable public @Nullable ResultKey findExecutableForAgent(long agentId, @NotNull @NotNull Collection<QueueOfExecutables.ExecutableData> executableData) Description copied from interface:ExecutableOrderProviderFrom 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:
findExecutableForAgentin interfaceExecutableOrderProvider
-
getOrderedExecutables
Description copied from interface:ExecutableOrderProviderReturns a full list of result keys of queued executables ordered with a global ordering.- Specified by:
getOrderedExecutablesin interfaceExecutableOrderProvider- Returns:
- the returned iterable has to be thread safe.
-
reorder
Description copied from interface:ExecutableOrderProviderCalled 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:
reorderin interfaceExecutableOrderProvider- Returns:
- true if the executable has successfully been moved, false otherwise.
-
removeByKey
Description copied from interface:ExecutableOrderProviderRemove items with aResultKey. Called if Bamboo detects that order provider contains references to items that are no longer accessible.- Specified by:
removeByKeyin interfaceExecutableOrderProvider
-