Package alluxio.heartbeat
Class FixedIntervalSupplier
- java.lang.Object
-
- alluxio.heartbeat.FixedIntervalSupplier
-
- All Implemented Interfaces:
SleepIntervalSupplier
public class FixedIntervalSupplier extends java.lang.Object implements SleepIntervalSupplier
Fixed interval supplier.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
mLogger
-
Constructor Summary
Constructors Constructor Description FixedIntervalSupplier(long fixedInterval)
Constructs a newFixedIntervalSupplier
.FixedIntervalSupplier(long fixedInterval, org.slf4j.Logger logger)
Constructs a newFixedIntervalSupplier
.
-
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
-
FixedIntervalSupplier
public FixedIntervalSupplier(long fixedInterval, org.slf4j.Logger logger)
Constructs a newFixedIntervalSupplier
.- Parameters:
fixedInterval
- the fixed intervallogger
- the logger
-
FixedIntervalSupplier
public FixedIntervalSupplier(long fixedInterval)
Constructs a newFixedIntervalSupplier
.- Parameters:
fixedInterval
- 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
-
-