Class Interval

java.lang.Object
org.voltdb.task.Interval

public class Interval extends Object
Class to represent the time interval which should elapse before an action is performed. Includes an interval and a callback to retrieve the next interval.
  • Constructor Details

    • Interval

      public Interval(long interval, TimeUnit timeUnit, Function<ActionResult,Interval> callback)
      Constructor for an Interval.
      Parameters:
      interval - the intended amount of time
      timeUnit - unit in which the interval is expressed
      callback - callback to retrieve the next interval
  • Method Details

    • getInterval

      public long getInterval(TimeUnit timeUnit)
      Parameters:
      timeUnit - Of the returned interval
      Returns:
      The time interval until the action should be performed
    • getCallback

      public Function<ActionResult,Interval> getCallback()
      Returns:
      callback which should be invoked after the action is performed to get next interval
    • toString

      public String toString()
      Overrides:
      toString in class Object