Package alluxio.heartbeat
Class CronExpressionIntervalSupplier
- java.lang.Object
-
- alluxio.heartbeat.CronExpressionIntervalSupplier
-
- All Implemented Interfaces:
SleepIntervalSupplier
public class CronExpressionIntervalSupplier extends java.lang.Object implements SleepIntervalSupplier
Calculate the next interval by given cron expression.
-
-
Constructor Summary
Constructors Constructor Description CronExpressionIntervalSupplier(org.apache.logging.log4j.core.util.CronExpression cronExpression, long fixedInterval)
Constructs a newCronExpressionIntervalSupplier
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getNextInterval(long mPreviousTickedMs, long nowTimeStampMillis)
Gets the next interval for sleeping.long
getRunLimit(long mPreviousTickedMs)
Gets the run limit from previous ticked.
-
-
-
Constructor Detail
-
CronExpressionIntervalSupplier
public CronExpressionIntervalSupplier(org.apache.logging.log4j.core.util.CronExpression cronExpression, long fixedInterval)
Constructs a newCronExpressionIntervalSupplier
.- Parameters:
cronExpression
- the cron expressionfixedInterval
- the fixed interval
-
-
Method Detail
-
getNextInterval
public long getNextInterval(long mPreviousTickedMs, long nowTimeStampMillis)
Description copied from interface:SleepIntervalSupplier
Gets the next interval for sleeping.- Specified by:
getNextInterval
in interfaceSleepIntervalSupplier
- Parameters:
mPreviousTickedMs
- previous ticked time stamp in millisecondnowTimeStampMillis
- current time stamp in millisecond- Returns:
- the interval to sleep starting from now before next time the timer triggers
-
getRunLimit
public long getRunLimit(long mPreviousTickedMs)
Description copied from interface:SleepIntervalSupplier
Gets the run limit from previous ticked.- Specified by:
getRunLimit
in interfaceSleepIntervalSupplier
- Parameters:
mPreviousTickedMs
- previous ticked time stamp in millisecond- Returns:
- the run limit
-
-