Class JCloudsPreCreationThread
java.lang.Object
java.util.TimerTask
hudson.triggers.SafeTimerTask
hudson.model.PeriodicWork
hudson.model.AsyncPeriodicWork
jenkins.plugins.openstack.compute.JCloudsPreCreationThread
- All Implemented Interfaces:
ExtensionPoint
,Runnable
@Extension
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class JCloudsPreCreationThread
extends AsyncPeriodicWork
Periodically ensure enough slaves are created.
The goal of this class is to pre-provision slaves ahead of time to avoid jobs
having to wait until a slave gets provisioned to run.
It works in conjunction with the logic in JCloudsRetentionStrategy to not
only pre-provision slaves but also keep the slaves around to meet
requirements.
The behaviour is configured via the `instanceMin` setting which controls
how many instances per-template will be pre-provisioned.
A template's retention time of 0 (zero) will be interpreted as a sign that
used instances shouldn't be re-used and thus new instances will be
pre-provisioned, even if used instances are running.
The pre-provisioning always respects the instance capacity (either global or
per template).
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.triggers.SafeTimerTask
SafeTimerTask.ExceptionRunnable
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.AsyncPeriodicWork
name
Fields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(TaskListener listener) protected Level
long
protected Level
Methods inherited from class hudson.model.AsyncPeriodicWork
createListener, doRun, getErrorLoggingLevel, getLogFile
Methods inherited from class hudson.model.PeriodicWork
all, getInitialDelay, init
Methods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, run
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
Constructor Details
-
JCloudsPreCreationThread
public JCloudsPreCreationThread()
-
-
Method Details
-
getRecurrencePeriod
public long getRecurrencePeriod()- Specified by:
getRecurrencePeriod
in classPeriodicWork
-
execute
- Specified by:
execute
in classAsyncPeriodicWork
-
getNormalLoggingLevel
- Overrides:
getNormalLoggingLevel
in classAsyncPeriodicWork
-
getSlowLoggingLevel
- Overrides:
getSlowLoggingLevel
in classAsyncPeriodicWork
-