Package hudson.plugins.ec2
Class EC2RetentionStrategy
- All Implemented Interfaces:
ExtensionPoint,Describable<RetentionStrategy<?>>,ExecutorListener
public class EC2RetentionStrategy
extends RetentionStrategy<EC2Computer>
implements ExecutorListener
RetentionStrategy for EC2.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.slaves.RetentionStrategy
RetentionStrategy.Always, RetentionStrategy.DemandNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanfinal intNumber of minutes of idleness before an instance should be terminated.Fields inherited from class hudson.slaves.RetentionStrategy
INSTANCE, LIST, NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcheck(EC2Computer c) Lightweight path: returns immediately so the Queue lock is not held during EC2 API calls.protected Objectvoidstart(EC2Computer c) Lightweight path: returns immediately.voidtaskAccepted(Executor executor, Queue.Task task) voidtaskCompleted(Executor executor, Queue.Task task, long durationMS) voidtaskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) Methods inherited from class hudson.slaves.RetentionStrategy
all, isAcceptingTasks, isManualLaunchAllowedMethods inherited from class hudson.model.AbstractDescribableImpl
getDescriptorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.ExecutorListener
taskStarted
-
Field Details
-
DISABLED
public static final boolean DISABLED -
idleTerminationMinutes
public final int idleTerminationMinutesNumber of minutes of idleness before an instance should be terminated. A value of zero indicates that the instance should never be automatically terminated. Negative values are times in remaining minutes before end of billing period.
-
-
Constructor Details
-
EC2RetentionStrategy
-
-
Method Details
-
check
Lightweight path: returns immediately so the Queue lock is not held during EC2 API calls. Heavy work (getState, getUptime, idle timeout, reconnect) is scheduled to run asynchronously outside the Queue lock. See docs/EC2_QUEUE_AUDIT.md.- Specified by:
checkin classRetentionStrategy<EC2Computer>
-
start
Lightweight path: returns immediately. Heavy work (getState, connect) runs asynchronously so the caller is not blocked by EC2 API calls.- Overrides:
startin classRetentionStrategy<EC2Computer>
-
readResolve
-
taskAccepted
- Specified by:
taskAcceptedin interfaceExecutorListener
-
taskCompleted
- Specified by:
taskCompletedin interfaceExecutorListener
-
taskCompletedWithProblems
public void taskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) - Specified by:
taskCompletedWithProblemsin interfaceExecutorListener
-