public class TestingLaunchConstrainer extends java.lang.Object implements LaunchConstrainer
LaunchConstrainer that makes it easy to enable/disable launches for testing.
Defaults to allowing all launches.
| Constructor and Description |
|---|
TestingLaunchConstrainer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLaunch(RecoveryType recoveryType)
Determines whether the given
RecoveryType
can be launchHappened right now. |
void |
launchHappened(LaunchOfferRecommendation recommendation,
RecoveryType recoveryType)
Invoked every time a task is launchHappened.
|
void |
setCanLaunch(boolean canLaunch) |
public void setCanLaunch(boolean canLaunch)
public void launchHappened(LaunchOfferRecommendation recommendation, RecoveryType recoveryType)
LaunchConstrainer
We take a Operation so that frameworks can specify additional metadata, in order to smooth the launch
rate.
launchHappened in interface LaunchConstrainerrecommendation - The OfferRecommendation containing the Launch Operation which occurredrecoveryType - The type of the recovery which has been executedpublic boolean canLaunch(RecoveryType recoveryType)
LaunchConstrainerRecoveryType
can be launchHappened right now.canLaunch in interface LaunchConstrainerrecoveryType - The RecoveryType to be examinedtrue if the offer is safe to launch immediately, false if it should wait