Class EphemeralAgentsLaunchRequestRegistryImpl
- java.lang.Object
-
- com.atlassian.bamboo.agent.ephemeral.EphemeralAgentsLaunchRequestRegistryImpl
-
- All Implemented Interfaces:
EphemeralAgentsLaunchRequestRegistry
public class EphemeralAgentsLaunchRequestRegistryImpl extends Object implements EphemeralAgentsLaunchRequestRegistry
-
-
Constructor Summary
Constructors Constructor Description EphemeralAgentsLaunchRequestRegistryImpl(@NotNull EphemeralAgentExecutionService ephemeralAgentExecutionService, @NotNull ElasticInstanceManager elasticInstanceManager, @NotNull BambooLicenseManager bambooLicenseManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @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(@NotNull ResultKey resultKey)
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 Detail
-
EphemeralAgentsLaunchRequestRegistryImpl
public EphemeralAgentsLaunchRequestRegistryImpl(@NotNull @NotNull EphemeralAgentExecutionService ephemeralAgentExecutionService, @NotNull @NotNull ElasticInstanceManager elasticInstanceManager, @NotNull @NotNull BambooLicenseManager bambooLicenseManager)
-
-
Method Detail
-
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
public void markRequestFailed(@NotNull @NotNull ResultKey resultKey)
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
public void remove(@NotNull @NotNull ResultKey resultKey)
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
public boolean requestForKeyExists(ResultKey typedResultKey)
- Specified by:
requestForKeyExists
in interfaceEphemeralAgentsLaunchRequestRegistry
- Returns:
- true iff launch request has been registered for the
ResultKey
-
-