com.atlassian.bamboo.v2.build.queue
Interface QueueOfExecutables

All Known Implementing Classes:
AbstractQueueOfExecutables, OffloadingQueueOfExecutables, SimpleQueueOfExecutables

@ThreadSafe
public interface QueueOfExecutables

Provides an unordered store for executables.


Nested Class Summary
static class QueueOfExecutables.ExecutableData
          Stores basic data about an executable.
 
Method Summary
 void enqueue(CommonContext context)
          Adds a new executable to store.
 com.google.common.collect.ImmutableList<QueueOfExecutables.ExecutableData> executablesForAgent(long agentId)
          Returns executables available for an agent.
 CommonContext get(ResultKey resultKey)
          Retrieves an executable with given key from storage.
 CommonContext inflight(ResultKey resultKey)
          Called when a given executable is en route to agent.
 void recalculateExecutors()
          Recalculates executors for all executables - until then, any information about executor-executable mapping should be considered to be invalid.
 void recalculateExecutors(Key planKey)
          Recalculates executors for a given plan - until then, any information about executor-executable mapping for this plan should be considered to be invalid.
 CommonContext remove(ResultKey resultKey)
          Called when an executable should be removed from the queue.
 int size()
          Returns the amount of executables in queue (not counting executables in flight)
 

Method Detail

get

@Nullable
CommonContext get(@NotNull
                           ResultKey resultKey)
Retrieves an executable with given key from storage.


enqueue

void enqueue(@NotNull
             CommonContext context)
Adds a new executable to store. will not be called concurrently

Parameters:
context -

inflight

@Nullable
CommonContext inflight(@NotNull
                                ResultKey resultKey)
Called when a given executable is en route to agent. May be implemented as a simple remove(). Executables in flight should be treated as removed, but may be put back into a queue if an agent fails to acknolwedge that it received the executable.

Returns:
the removed context

remove

@Nullable
CommonContext remove(@NotNull
                              ResultKey resultKey)
Called when an executable should be removed from the queue. will not be called concurrently

Returns:
the removed context

executablesForAgent

@NotNull
com.google.common.collect.ImmutableList<QueueOfExecutables.ExecutableData> executablesForAgent(long agentId)
Returns executables available for an agent.


recalculateExecutors

void recalculateExecutors(@NotNull
                          Key planKey)
Recalculates executors for a given plan - until then, any information about executor-executable mapping for this plan should be considered to be invalid.


recalculateExecutors

void recalculateExecutors()
Recalculates executors for all executables - until then, any information about executor-executable mapping should be considered to be invalid.


size

int size()
Returns the amount of executables in queue (not counting executables in flight)



Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.