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.ExceptionRunnableNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.AsyncPeriodicWork
nameFields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(TaskListener listener) protected Levellongprotected LevelMethods inherited from class hudson.model.AsyncPeriodicWork
createListener, doRun, getErrorLoggingLevel, getLogFileMethods inherited from class hudson.model.PeriodicWork
all, getInitialDelay, initMethods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, runMethods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
Constructor Details
-
JCloudsPreCreationThread
public JCloudsPreCreationThread()
-
-
Method Details
-
getRecurrencePeriod
public long getRecurrencePeriod()- Specified by:
getRecurrencePeriodin classPeriodicWork
-
execute
- Specified by:
executein classAsyncPeriodicWork
-
getNormalLoggingLevel
- Overrides:
getNormalLoggingLevelin classAsyncPeriodicWork
-
getSlowLoggingLevel
- Overrides:
getSlowLoggingLevelin classAsyncPeriodicWork
-