Package com.illumon.iris.db.v2.replay
Interface ReplayerInterface
- All Known Implementing Classes:
DataDrivenReplayer
,FixedStepReplayer
,ReplayClient
,Replayer
public interface ReplayerInterface
An interface for replaying historical data as simulated real-time data.
-
Method Summary
Modifier and Type Method Description DBDateTime
currentTime()
Simulated time.ReplayerHandle
getHandle()
Gets a handle to the replayer.boolean
isDone()
Has the replayer finished replaying all data.Table
replay(Table dataSource, String timeColumn)
Prepares a historical table for replaying.Table
replayGrouped(Table dataSource, String timeColumn, String byColumn)
Prepares a grouped historical table for replaying.Table
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
shutdown()
Shuts down the replayer.void
start()
Starts replaying data.void
waitDone(long maxTimeMillis)
Wait a specified interval for the replayer to complete.
-
Method Details
-
start
Starts replaying data.- Throws:
IOException
-
isDone
Has the replayer finished replaying all data.- Returns:
- true if the replayer has finished replaying all data; false otherwise.
- Throws:
IOException
-
shutdown
Shuts down the replayer.- Throws:
IOException
- problem shutting down the replayer.
-
waitDone
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
Schedule a task to execute.- Parameters:
task
- task to executedelay
- delay in milliseconds before first executing the taskperiod
- frequency in milliseconds to execute the task.
-
currentTime
Simulated time.- Returns:
- simulated time.
- Throws:
IOException
-
replay
Prepares a historical table for replaying.- Parameters:
dataSource
- historical table to replaytimeColumn
- column in the table containing timestamps- Returns:
- dynamic, replayed version of the table.
- Throws:
IOException
-
replayGrouped
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 replaytimeColumn
- 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 IOExceptionPrepares a grouped historical table for replaying as a last-by table.- Parameters:
dataSource
- historical table to replaytimeColumn
- column in the table containing timestampsgroupingColumns
- 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.
-