Package com.atlassian.bamboo.plan
Class NonBlockingPlanExecutionServiceImpl
java.lang.Object
com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl
- All Implemented Interfaces:
NonBlockingPlanExecutionService
public class NonBlockingPlanExecutionServiceImpl
extends Object
implements NonBlockingPlanExecutionService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EventLoggingThreadPoolExecutorprotected final PlanExecutionLaunchControl -
Constructor Summary
ConstructorsModifierConstructorDescriptionNonBlockingPlanExecutionServiceImpl(PlanExecutionManager planExecutionManager, PlanExecutionLaunchControl planExecutionLaunchControl) protectedNonBlockingPlanExecutionServiceImpl(PlanExecutionManager planExecutionManager, PlanExecutionLaunchControl planExecutionLaunchControl, int threadCount, long threadIdleTimeout) protectedNonBlockingPlanExecutionServiceImpl(PlanExecutionManager planExecutionManager, PlanExecutionLaunchControl planExecutionLaunchControl, EventLoggingThreadPoolExecutor executor) -
Method Summary
Modifier and TypeMethodDescriptionvoidenqueueTrigger(@NotNull Triggerable triggerable, @NotNull Long triggerId, @NotNull BuildDetectionAction buildDetectionAction) @NotNull ExecutorStatsStats for the underlyingThreadPoolExecutor@NotNull QueueActivityStatsDtoGets analytical data from queue activity tracker and bring its initial state - start data collecting from scratch.shutdown()Stop accepting any more trigger requests.@Nullable Future<ExecutionRequestResult> tryToStart(@NotNull Triggerable triggerable, @NotNull BuildDetectionAction buildDetectionAction)
-
Field Details
-
planExecutionLaunchControl
-
executor
-
-
Constructor Details
-
NonBlockingPlanExecutionServiceImpl
public NonBlockingPlanExecutionServiceImpl(PlanExecutionManager planExecutionManager, PlanExecutionLaunchControl planExecutionLaunchControl) -
NonBlockingPlanExecutionServiceImpl
protected NonBlockingPlanExecutionServiceImpl(PlanExecutionManager planExecutionManager, PlanExecutionLaunchControl planExecutionLaunchControl, int threadCount, long threadIdleTimeout) -
NonBlockingPlanExecutionServiceImpl
protected NonBlockingPlanExecutionServiceImpl(PlanExecutionManager planExecutionManager, PlanExecutionLaunchControl planExecutionLaunchControl, EventLoggingThreadPoolExecutor executor)
-
-
Method Details
-
enqueueTrigger
public void enqueueTrigger(@NotNull @NotNull Triggerable triggerable, @NotNull @NotNull Long triggerId, @NotNull @NotNull BuildDetectionAction buildDetectionAction) Description copied from interface:NonBlockingPlanExecutionServiceSubmits a background task to runPlanExecutionManager.start(com.atlassian.bamboo.plan.cache.ImmutableChain, com.atlassian.bamboo.build.BuildDetectionAction, com.atlassian.bamboo.util.AcquisitionPolicy). Only oneAcquisitionPolicy.IMMEDIATEper planKey + triggerId combination will be queued at any point in time. The task are not guaranteed to be run, they might get dropped ifNonBlockingPlanExecutionService.tryToStart(Triggerable, BuildDetectionAction)is called. Rationale is: conditional triggers won't start anyway if there's a 'guaranteed' build run.To be used with automatic triggers: any auto Trigger can have Trigger Conditions defined
- Specified by:
enqueueTriggerin interfaceNonBlockingPlanExecutionService- Parameters:
triggerable-buildDetectionAction-
-
tryToStart
@Nullable public @Nullable Future<ExecutionRequestResult> tryToStart(@NotNull @NotNull Triggerable triggerable, @NotNull @NotNull BuildDetectionAction buildDetectionAction) Description copied from interface:NonBlockingPlanExecutionServiceSubmits a background task to runPlanExecutionManager.start(com.atlassian.bamboo.plan.cache.ImmutableChain, com.atlassian.bamboo.build.BuildDetectionAction, com.atlassian.bamboo.util.AcquisitionPolicy). The task usesAcquisitionPolicy.WAIT. To be used for triggers that are 'unconditional'. In other words, the method should be used for cases where build absolutely, positively needs to trigger (unless encountering internal error or hitting concurrent build limit)- Specified by:
tryToStartin interfaceNonBlockingPlanExecutionService- Parameters:
triggerable-buildDetectionAction-- Returns:
-
shutdown
Description copied from interface:NonBlockingPlanExecutionServiceStop accepting any more trigger requests.- Specified by:
shutdownin interfaceNonBlockingPlanExecutionService
-
getExecutorStats
Description copied from interface:NonBlockingPlanExecutionServiceStats for the underlyingThreadPoolExecutor- Specified by:
getExecutorStatsin interfaceNonBlockingPlanExecutionService- Returns:
-
getQueueActivityStatsAndRestoreToInitialState
Description copied from interface:NonBlockingPlanExecutionServiceGets analytical data from queue activity tracker and bring its initial state - start data collecting from scratch.- Specified by:
getQueueActivityStatsAndRestoreToInitialStatein interfaceNonBlockingPlanExecutionService- Returns:
- QueueActivityStatsDto with stat amounts
-