hudson.plugins.slave_squatter.squatters
Class CronSquatter
java.lang.Object
hudson.model.AbstractDescribableImpl<SlaveSquatter>
hudson.plugins.slave_squatter.SlaveSquatter
hudson.plugins.slave_squatter.squatters.CronSquatter
- All Implemented Interfaces:
- hudson.model.Describable<SlaveSquatter>
public class CronSquatter
- extends SlaveSquatter
Reserves a slave with a cron-like syntax that specifies the start of the reservation,
duration, and the size of the reservation.
- Author:
- Kohsuke Kawaguchi
|
Field Summary |
java.lang.String |
format
|
|
Method Summary |
int |
sizeOfReservation(long timestamp)
Returns the number of executors that should be reserved at the specified time. |
long |
timeOfNextChange(long timestamp)
Given the timestamp, return the nearest future timestamp (including itself --- the ceil semantics)
when the size of the reservation changes. |
| Methods inherited from class hudson.model.AbstractDescribableImpl |
getDescriptor |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
format
public final java.lang.String format
CronSquatter
@DataBoundConstructor
public CronSquatter(java.lang.String format)
sizeOfReservation
public int sizeOfReservation(long timestamp)
- Description copied from class:
SlaveSquatter
- Returns the number of executors that should be reserved at the specified time.
The timestamp is the same format as Date.getTime(). The precision is 1 minute,
and thus the caller should set the second and millisecond portion to 00.000.
- Specified by:
sizeOfReservation in class SlaveSquatter
timeOfNextChange
public long timeOfNextChange(long timestamp)
- Description copied from class:
SlaveSquatter
- Given the timestamp, return the nearest future timestamp (including itself --- the ceil semantics)
when the size of the reservation changes.
Hudson uses this information to figure out the scheduling that takes the future capacity change
into account.
- Specified by:
timeOfNextChange in class SlaveSquatter
Copyright © 2010. All Rights Reserved.