Class EphemeralAgentsLaunchRequestRegistryImpl
java.lang.Object
com.atlassian.bamboo.agent.ephemeral.EphemeralAgentsLaunchRequestRegistryImpl
- All Implemented Interfaces:
EphemeralAgentsLaunchRequestRegistry
public class EphemeralAgentsLaunchRequestRegistryImpl
extends Object
implements EphemeralAgentsLaunchRequestRegistry
-
Constructor Summary
ConstructorDescriptionEphemeralAgentsLaunchRequestRegistryImpl
(@NotNull EphemeralAgentExecutionService ephemeralAgentExecutionService, @NotNull ElasticInstanceManager elasticInstanceManager, @NotNull BambooLicenseManager bambooLicenseManager) -
Method Summary
Modifier and TypeMethodDescription@NotNull Pair<List<EphemeralAgentLaunchRequest>,
Integer> findEphemeralAgentsToLaunch
(int numberOfExtraReservedSlots) Find unhandled launch requests.void
launchOrDefer
(@NotNull EphemeralAgentLaunchRequest ephemeralAgentLaunchRequest) Register a new k8s pod launch request for a job/deployment.void
markRequestFailed
(@NotNull ResultKey resultKey) Mark launch as failed so that it can be retried later.void
Remove launch requests after it's either handled (agent picked up the job) or job is cancelled and removed from the build queue.boolean
requestForKeyExists
(ResultKey typedResultKey)
-
Constructor Details
-
EphemeralAgentsLaunchRequestRegistryImpl
public EphemeralAgentsLaunchRequestRegistryImpl(@NotNull @NotNull EphemeralAgentExecutionService ephemeralAgentExecutionService, @NotNull @NotNull ElasticInstanceManager elasticInstanceManager, @NotNull @NotNull BambooLicenseManager bambooLicenseManager)
-
-
Method Details
-
launchOrDefer
public void launchOrDefer(@NotNull @NotNull EphemeralAgentLaunchRequest ephemeralAgentLaunchRequest) Description copied from interface:EphemeralAgentsLaunchRequestRegistry
Register a new k8s pod launch request for a job/deployment.- Specified by:
launchOrDefer
in interfaceEphemeralAgentsLaunchRequestRegistry
-
markRequestFailed
Description copied from interface:EphemeralAgentsLaunchRequestRegistry
Mark launch as failed so that it can be retried later.- Specified by:
markRequestFailed
in interfaceEphemeralAgentsLaunchRequestRegistry
-
findEphemeralAgentsToLaunch
@NotNull public @NotNull Pair<List<EphemeralAgentLaunchRequest>,Integer> findEphemeralAgentsToLaunch(int numberOfExtraReservedSlots) Description copied from interface:EphemeralAgentsLaunchRequestRegistry
Find unhandled launch requests.- Specified by:
findEphemeralAgentsToLaunch
in interfaceEphemeralAgentsLaunchRequestRegistry
- Returns:
- list of launch requests to be handled and a total number of launch requests in progress, including the new ones.
-
remove
Description copied from interface:EphemeralAgentsLaunchRequestRegistry
Remove launch requests after it's either handled (agent picked up the job) or job is cancelled and removed from the build queue.- Specified by:
remove
in interfaceEphemeralAgentsLaunchRequestRegistry
-
requestForKeyExists
- Specified by:
requestForKeyExists
in interfaceEphemeralAgentsLaunchRequestRegistry
- Returns:
- true iff launch request has been registered for the
ResultKey
-