Class Replayer
java.lang.Object
io.deephaven.engine.table.impl.replay.Replayer
- All Implemented Interfaces:
ReplayerInterface,Runnable
- Direct Known Subclasses:
DataDrivenReplayer,FixedStepReplayer
Replay historical data as simulated real-time data.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclock()static ClockgetClock(ReplayerInterface replayer) Gets a time provider for the replayer.Gets a handle to the replayer.booleanisDone()Has the replayer finished replaying all data.voidregisterTimeSource(RowSet rowSet, ColumnSource<Instant> timestampSource) Register the time column and row set from a new table to replay.Prepares a historical table for replaying.replayGrouped(Table dataSource, String timeColumn, String groupingColumn) 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.voidrun()Refresh the simulated live tables.voidSchedule a task to execute.voidsetTime(long updatedTime) Sets the current replay time.voidshutdown()Shuts down the replayer.voidstart()Starts replaying data.voidwaitDone(long maxTimeMillis) Wait a specified interval for the replayer to complete.
-
Field Details
-
startTime
-
endTime
-
-
Constructor Details
-
Replayer
Creates a new replayer.- Parameters:
startTime- start timeendTime- end time
-
-
Method Details
-
start
public void start()Starts replaying data.- Specified by:
startin interfaceReplayerInterface
-
isDone
public boolean isDone()Has the replayer finished replaying all data.- Specified by:
isDonein interfaceReplayerInterface- Returns:
- true if the replayer has finished replaying all data; false otherwise.
-
shutdown
public void shutdown()Shuts down the replayer.- Specified by:
shutdownin interfaceReplayerInterface
-
waitDone
public void waitDone(long maxTimeMillis) 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:
waitDonein interfaceReplayerInterface- Parameters:
maxTimeMillis- maximum number of milliseconds to wait.- Throws:
CancellationException- thread was interrupted.
-
schedule
Schedule a task to execute.- Specified by:
schedulein interfaceReplayerInterface- Parameters:
task- task to executedelayMillis- delay in milliseconds before first executing the taskperiodMillis- frequency in milliseconds to execute the task.
-
getClock
Gets a time provider for the replayer. The time provider returns the current replay time.- Parameters:
replayer- replayer- Returns:
- time provider that returns the current replay time.
-
setTime
public void setTime(long updatedTime) Sets the current replay time.- Specified by:
setTimein interfaceReplayerInterface- Parameters:
updatedTime- new replay time.
-
replay
Prepares a historical table for replaying.- Specified by:
replayin interfaceReplayerInterface- Parameters:
dataSource- historical table to replaytimeColumn- column in the table containing timestamps- Returns:
- dynamic, replayed version of the table.
-
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.- Specified by:
replayGroupedin interfaceReplayerInterface- Parameters:
dataSource- historical table to replaytimeColumn- column in the table containing timestamps- Returns:
- dynamic, replayed version of the table.
-
replayGroupedLastBy
Prepares a grouped historical table for replaying as a last-by table.- Specified by:
replayGroupedLastByin interfaceReplayerInterface- 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.
-
registerTimeSource
Register the time column and row set from a new table to replay. Most users will usereplay,replayGrouped, orreplayGroupedLastByinstead of this function.- Parameters:
rowSet- table row settimestampSource- column source containing time information.
-
run
public void run()Refresh the simulated live tables. -
getHandle
Gets a handle to the replayer.- Specified by:
getHandlein interfaceReplayerInterface- Returns:
- handle to the replayer.
-
clock
- Specified by:
clockin interfaceReplayerInterface
-