|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.v2.build.queue.BuildQueueManagerImpl
public class BuildQueueManagerImpl
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.bamboo.v2.build.queue.BuildQueueManager |
---|
BuildQueueManager.QueuedResultKey, BuildQueueManager.QueueItemView<T> |
Field Summary |
---|
Fields inherited from interface com.atlassian.bamboo.v2.build.queue.BuildQueueManager |
---|
DISABLE_BUILD_SYSTEM_PROPERTY |
Constructor Summary | |
---|---|
BuildQueueManagerImpl(com.atlassian.event.api.EventPublisher eventPublisher,
BuildExecutionManager buildExecutionManager,
CachedPlanManager cachedPlanManager,
com.atlassian.plugin.PluginAccessor pluginAccessor,
ErrorUpdateHandler errorUpdateHandler,
ExecutableAgentsHelper executableAgentsHelper,
CustomVariableContextRunner customVariableContextRunner,
EnvironmentService environmentService,
ExecutionPhaseService executionPhaseService,
XStreamFactory xStreamFactory,
org.springframework.transaction.support.TransactionTemplate transactionTemplate,
LocalResultProcessor resultProcessor,
long responseTimeout)
|
Method Summary | |
---|---|
void |
addToQueue(CommonContext context)
Attempts to add the build to a queue. |
Iterable<CommonContext> |
getBuildQueue()
Returns a list of CommonContext objects currently in the build queue. |
Iterable<BuildQueueManager.QueuedResultKey> |
getQueuedExecutables()
|
BuildQueuePosition |
getQueuePosition(ResultKey resultKey)
Returns information on position of plan result in the queue. |
com.google.common.collect.ImmutableList<CommonContext> |
getRecentBuildQueue()
Returns a list of CommonContext objects currently in the build queue. |
void |
invalidateExecutors(Key key)
|
void |
invalidateExecutors(String reason)
|
BuildQueueManager.QueueItemView<CommonContext> |
peekContext(ResultKey resultKey)
Returns a queued CommonContext for given resultKey. |
void |
removeAllBuildsForPlanFromQueue(PlanKey planKey)
Removes all the CommonContext associated with the planKey to be removed from the queue. |
void |
removeBuildFromQueue(ResultKey resultKey)
Removes the CommonContext associated with the resultKey to be removed from the queue. |
void |
reorderBuildInQueue(String planKey,
int index)
Reorders the build queue. |
boolean |
reorderBuildInQueue(String buildResultKey,
String prevBuildResultKey,
String nextBuildResultKey)
Moves a given build in a queue in between two given builds. |
boolean |
reorderInQueue(ResultKey resultKey,
int index)
Reorders the build queue. |
void |
restoreState(Set<ResultKey> buildsToRestore)
Restore state after server restart. |
CommonContext |
takeBuildContext(long agentId)
Takes a BuildContext from the queue, blocking until one is available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BuildQueueManagerImpl(@NotNull com.atlassian.event.api.EventPublisher eventPublisher, @NotNull BuildExecutionManager buildExecutionManager, @NotNull CachedPlanManager cachedPlanManager, @NotNull com.atlassian.plugin.PluginAccessor pluginAccessor, @NotNull ErrorUpdateHandler errorUpdateHandler, @NotNull ExecutableAgentsHelper executableAgentsHelper, @NotNull CustomVariableContextRunner customVariableContextRunner, @NotNull EnvironmentService environmentService, @NotNull ExecutionPhaseService executionPhaseService, @NotNull XStreamFactory xStreamFactory, @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @NotNull LocalResultProcessor resultProcessor, long responseTimeout)
Method Detail |
---|
public void addToQueue(@NotNull CommonContext context)
BuildQueueManager
BuildQueuedEvent
is fired if queuing was successful and a BuildRejectedFromQueueEvent
iif rejected.
A lock on the build is obtained from the BuildExecutionManager
.
addToQueue
in interface BuildQueueManager
context
- @NotNullpublic void removeBuildFromQueue(@NotNull ResultKey resultKey)
BuildQueueManager
CommonContext
associated with the resultKey to be removed from the queue. A BuildDeQueuedEvent
is fired.
The lock on the build is not released. The caller should call BuildExecutionManager#finishProcess
to
release this lock when ready.
removeBuildFromQueue
in interface BuildQueueManager
public void removeAllBuildsForPlanFromQueue(@NotNull PlanKey planKey)
BuildQueueManager
CommonContext
associated with the planKey to be removed from the queue. A BuildDeQueuedEvent
is fired.
The lock on the build is not released. The caller should call BuildExecutionManager#finishProcess
to
release this lock when ready.
removeAllBuildsForPlanFromQueue
in interface BuildQueueManager
public void reorderBuildInQueue(String planKey, int index)
BuildQueueManager
CommonContext
associated with the planKey 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.
reorderBuildInQueue
in interface BuildQueueManager
planKey
- Plan key of the build that shall be repositioned in the queue.index
- New position of a CommonContext
associated with the planKey in the queue.public boolean reorderInQueue(ResultKey resultKey, int index)
BuildQueueManager
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.
reorderInQueue
in interface BuildQueueManager
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.public boolean reorderBuildInQueue(@NotNull String buildResultKey, @Nullable String prevBuildResultKey, @Nullable String nextBuildResultKey)
BuildQueueManager
reorderBuildInQueue
in interface BuildQueueManager
@NotNull public BuildQueuePosition getQueuePosition(@NotNull ResultKey resultKey)
BuildQueueManager
getQueuePosition
in interface BuildQueueManager
resultKey
- identifies plan result
public void invalidateExecutors(@NotNull String reason)
invalidateExecutors
in interface BuildQueueManager
public void invalidateExecutors(@NotNull Key key)
invalidateExecutors
in interface BuildQueueManager
@NotNull public Iterable<BuildQueueManager.QueuedResultKey> getQueuedExecutables()
getQueuedExecutables
in interface BuildQueueManager
@NotNull public com.google.common.collect.ImmutableList<CommonContext> getRecentBuildQueue()
BuildQueueManager
CommonContext
objects currently in the build queue. If there are any pending queue
operations, this method will return the latest known queue state.
getRecentBuildQueue
in interface BuildQueueManager
List
of CommonContext
. Changes to this List is not reflected in the queue.@NotNull public Iterable<CommonContext> getBuildQueue()
BuildQueueManager
CommonContext
objects currently in the build queue. If there are any pending queue
operations, this method will return the latest known queue state.
Consider using for queue access
getBuildQueue
in interface BuildQueueManager
List
of CommonContext
. Changes to this List is not reflected in the queue.public BuildQueueManager.QueueItemView<CommonContext> peekContext(@NotNull ResultKey resultKey)
BuildQueueManager
for your build queue viewing needs
peekContext
in interface BuildQueueManager
public void restoreState(Set<ResultKey> buildsToRestore)
BuildQueueManager
restoreState
in interface BuildQueueManager
buildsToRestore
- keys of results that it makes sense to restore@Nullable public CommonContext takeBuildContext(long agentId) throws InterruptedException
AgentQueueAccessor
BuildContext
from the queue, blocking until one is available.
The lock on the build is not released. The caller should call BuildExecutionManager#finishProcess
to
release this lock when ready.
takeBuildContext
in interface AgentQueueAccessor
BuildContext
, null in case of timeout on retrieval.
InterruptedException
- if the calling Thread
is interrupted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |