@Internal @ThreadSafe public interface BuildQueueManager extends AgentQueueAccessor
Modifier and Type | Interface and Description |
---|---|
static class |
BuildQueueManager.QueuedResultKey |
static class |
BuildQueueManager.QueueItemView<T> |
Modifier and Type | Field and Description |
---|---|
static String |
DISABLE_BUILD_SYSTEM_PROPERTY |
Modifier and Type | Method and Description |
---|---|
void |
addToQueue(CommonContext context)
Attempts to add the build to a queue.
|
Set<Long> |
getExecutorsForQueuedExecutable(ResultKey resultKey) |
Collection<ElasticImageConfiguration> |
getImagesForQueuedExecutable(ResultKey resultKey) |
Iterable<BuildQueueManager.QueuedResultKey> |
getQueuedExecutables() |
BuildQueuePosition |
getQueuePosition(ResultKey resultKey)
Returns information on position of plan result in the queue.
|
void |
invalidateExecutables(BuildAgent buildAgent)
Updates all agent-executable mappings for a given agent.
|
void |
invalidateExecutors(Key planKey) |
void |
invalidateExecutors(String reason) |
BuildQueueManager.QueueItemView<CommonContext> |
peekContext(ResultKey resultKey)
Returns a queued CommonContext for given resultKey.
|
void |
removeBuildFromQueue(ResultKey resultKey)
Removes the
CommonContext associated with the resultKey to be removed from the queue. |
boolean |
reorderInQueue(ResultKey resultKey,
int index)
Reorders the build queue.
|
void |
restoreState(Set<ResultKey> resultsToRestore)
Restore state after server restart.
|
takeBuildContext
static final String DISABLE_BUILD_SYSTEM_PROPERTY
void addToQueue(@NotNull CommonContext context)
A lock on the build is obtained from the BuildExecutionManager
.
context
- {@link
- IllegalStateException} if the build is already queuedvoid removeBuildFromQueue(@NotNull ResultKey resultKey)
CommonContext
associated with the resultKey to be removed from the queue.
The lock on the build is not released. The caller should call com.atlassian.bamboo.build.BuildExecutionManager#finishBuild(PlanResultKey)
to
release this lock when ready.
resultKey
- @Nullable BuildQueueManager.QueueItemView<CommonContext> peekContext(@NotNull ResultKey resultKey)
resultKey
- boolean reorderInQueue(ResultKey resultKey, int index)
CommonContext
associated with the resultKey is moved to new position in the queue
indicated by the zero-based index parameter. If index is < 0 or >= size of queue then CommonContext
is
positioned at the beginning or at the end of the queue respectively.resultKey
- Result key of the build that shall be repositioned in the queue.index
- New position of a CommonContext
associated with the planKey in the queue.@NotNull BuildQueuePosition getQueuePosition(@NotNull ResultKey resultKey)
resultKey
- identifies plan resultvoid invalidateExecutors(@NotNull String reason)
void invalidateExecutors(@NotNull Key planKey)
void invalidateExecutables(@NotNull BuildAgent buildAgent)
@NotNull Iterable<BuildQueueManager.QueuedResultKey> getQueuedExecutables()
@Nullable Collection<ElasticImageConfiguration> getImagesForQueuedExecutable(@NotNull ResultKey resultKey)
@Nullable Set<Long> getExecutorsForQueuedExecutable(@NotNull ResultKey resultKey)
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.