Class ReplayClient

java.lang.Object
com.illumon.iris.db.v2.replay.ReplayClient
All Implemented Interfaces:
ReplayerInterface

public class ReplayClient extends Object implements ReplayerInterface
  • Constructor Details

  • Method Details

    • start

      public void start() throws IOException
      Description copied from interface: ReplayerInterface
      Starts replaying data.
      Specified by:
      start in interface ReplayerInterface
      Throws:
      IOException
    • currentTime

      public DBDateTime currentTime() throws IOException
      Description copied from interface: ReplayerInterface
      Simulated time.
      Specified by:
      currentTime in interface ReplayerInterface
      Returns:
      simulated time.
      Throws:
      IOException
    • replay

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

      public Table replayGrouped(Table dataSource, String timeColumn, String groupColumn) throws IOException
      Description copied from interface: ReplayerInterface
      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.
      Specified by:
      replayGrouped in interface ReplayerInterface
      Parameters:
      dataSource - historical table to replay
      timeColumn - column in the table containing timestamps
      Returns:
      dynamic, replayed version of the table.
      Throws:
      IOException
    • replayGroupedLastBy

      public Table replayGroupedLastBy(Table dataSource, String timeColumn, String[] groupColumn) throws IOException
      Description copied from interface: ReplayerInterface
      Prepares a grouped historical table for replaying as a last-by table.
      Specified by:
      replayGroupedLastBy in interface ReplayerInterface
      Parameters:
      dataSource - historical table to replay
      timeColumn - column in the table containing timestamps
      groupColumn - columns used as the key in computing last-by
      Returns:
      dynamic, replayed version of the last-by table.
      Throws:
      IOException
    • getHandle

      public ReplayerHandle getHandle()
      Description copied from interface: ReplayerInterface
      Gets a handle to the replayer.
      Specified by:
      getHandle in interface ReplayerInterface
      Returns:
      handle to the replayer.
    • replayGroupedLastBy

      public Table replayGroupedLastBy(Table dataSource, String timeColumn, String groupColumn) throws IOException
      Throws:
      IOException
    • shutdown

      public void shutdown() throws IOException
      Description copied from interface: ReplayerInterface
      Shuts down the replayer.
      Specified by:
      shutdown in interface ReplayerInterface
      Throws:
      IOException - problem shutting down the replayer.
    • waitDone

      public void waitDone(long maxTimeMillis) throws IOException
      Description copied from interface: ReplayerInterface
      Wait a specified interval for the replayer to complete. If the replayer has not completed by the end of the interval, the method returns.
      Specified by:
      waitDone in interface ReplayerInterface
      Parameters:
      maxTimeMillis - maximum number of milliseconds to wait.
      Throws:
      IOException - problems encountered
    • isDone

      public boolean isDone() throws IOException
      Description copied from interface: ReplayerInterface
      Has the replayer finished replaying all data.
      Specified by:
      isDone in interface ReplayerInterface
      Returns:
      true if the replayer has finished replaying all data; false otherwise.
      Throws:
      IOException
    • setTime

      public void setTime(long updatedTime)
      Description copied from interface: ReplayerInterface
      Sets the current replay time.
      Specified by:
      setTime in interface ReplayerInterface
      Parameters:
      updatedTime - new replay time.
    • schedule

      public void schedule(TimerTask flushTask, long minute, long minute1)
      Description copied from interface: ReplayerInterface
      Schedule a task to execute.
      Specified by:
      schedule in interface ReplayerInterface
      Parameters:
      flushTask - task to execute
      minute - delay in milliseconds before first executing the task
      minute1 - frequency in milliseconds to execute the task.