Interface ReplayerInterface

All Known Implementing Classes:
DataDrivenReplayer, FixedStepReplayer, Replayer

public interface ReplayerInterface
An interface for replaying historical data as simulated real-time data.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Gets a handle to the replayer.
    boolean
    Has the replayer finished replaying all data.
    replay(Table dataSource, String timeColumn)
    Prepares a historical table for replaying.
    replayGrouped(Table dataSource, String timeColumn, String byColumn)
    Prepares a grouped historical table for replaying.
    replayGroupedLastBy(Table dataSource, String timeColumn, String... groupingColumns)
    Prepares a grouped historical table for replaying as a last-by table.
    void
    schedule(TimerTask task, long delay, long period)
    Schedule a task to execute.
    void
    setTime(long updatedTime)
    Sets the current replay time.
    void
    Shuts down the replayer.
    void
    Starts replaying data.
    void
    waitDone(long maxTimeMillis)
    Wait a specified interval for the replayer to complete.
  • Method Details

    • start

      void start() throws IOException
      Starts replaying data.
      Throws:
      IOException
    • isDone

      boolean isDone() throws IOException
      Has the replayer finished replaying all data.
      Returns:
      true if the replayer has finished replaying all data; false otherwise.
      Throws:
      IOException
    • shutdown

      void shutdown()
      Shuts down the replayer.
    • waitDone

      void waitDone(long maxTimeMillis) throws IOException
      Wait a specified interval for the replayer to complete. If the replayer has not completed by the end of the interval, the method returns.
      Parameters:
      maxTimeMillis - maximum number of milliseconds to wait.
      Throws:
      IOException - problems encountered
    • setTime

      void setTime(long updatedTime)
      Sets the current replay time.
      Parameters:
      updatedTime - new replay time.
    • schedule

      void schedule(TimerTask task, long delay, long period)
      Schedule a task to execute.
      Parameters:
      task - task to execute
      delay - delay in milliseconds before first executing the task
      period - frequency in milliseconds to execute the task.
    • replay

      Table replay(Table dataSource, String timeColumn) throws IOException
      Prepares a historical table for replaying.
      Parameters:
      dataSource - historical table to replay
      timeColumn - column in the table containing timestamps
      Returns:
      dynamic, replayed version of the table.
      Throws:
      IOException
    • replayGrouped

      Table replayGrouped(Table dataSource, String timeColumn, String byColumn) throws IOException
      Prepares a grouped historical table for replaying. This method can be faster than the ungrouped replay, but the performance increase comes with a cost. Within a group, the data ordering is maintained. Between groups, data ordering is not maintained for a time interval.
      Parameters:
      dataSource - historical table to replay
      timeColumn - column in the table containing timestamps
      Returns:
      dynamic, replayed version of the table.
      Throws:
      IOException
    • replayGroupedLastBy

      Table replayGroupedLastBy(Table dataSource, String timeColumn, String... groupingColumns) throws IOException
      Prepares a grouped historical table for replaying as a last-by table.
      Parameters:
      dataSource - historical table to replay
      timeColumn - column in the table containing timestamps
      groupingColumns - columns used as the key in computing last-by
      Returns:
      dynamic, replayed version of the last-by table.
      Throws:
      IOException
    • getHandle

      ReplayerHandle getHandle()
      Gets a handle to the replayer.
      Returns:
      handle to the replayer.
    • clock

      Clock clock()