Package com.illumon.iris.db.v2.replay
Class ReplayClient
java.lang.Object
com.illumon.iris.db.v2.replay.ReplayClient
- All Implemented Interfaces:
ReplayerInterface
public class ReplayClient extends Object implements ReplayerInterface
-
Constructor Summary
Constructors Constructor Description ReplayClient(RemoteDatabase remoteDatabase, DBDateTime time, DBDateTime endTime, long increment, boolean dataDriven)
-
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 groupColumn)
Prepares a grouped historical table for replaying.Table
replayGroupedLastBy(Table dataSource, String timeColumn, String groupColumn)
Table
replayGroupedLastBy(Table dataSource, String timeColumn, String[] groupColumn)
Prepares a grouped historical table for replaying as a last-by table.void
schedule(TimerTask flushTask, long minute, long minute1)
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.
-
Constructor Details
-
ReplayClient
public ReplayClient(RemoteDatabase remoteDatabase, DBDateTime time, DBDateTime endTime, long increment, boolean dataDriven) throws IOException- Throws:
IOException
-
-
Method Details
-
start
Description copied from interface:ReplayerInterface
Starts replaying data.- Specified by:
start
in interfaceReplayerInterface
- Throws:
IOException
-
currentTime
Description copied from interface:ReplayerInterface
Simulated time.- Specified by:
currentTime
in interfaceReplayerInterface
- Returns:
- simulated time.
- Throws:
IOException
-
replay
Description copied from interface:ReplayerInterface
Prepares a historical table for replaying.- Specified by:
replay
in interfaceReplayerInterface
- Parameters:
dataSource
- historical table to replaytimeColumn
- 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 IOExceptionDescription 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 interfaceReplayerInterface
- Parameters:
dataSource
- historical table to replaytimeColumn
- 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 IOExceptionDescription copied from interface:ReplayerInterface
Prepares a grouped historical table for replaying as a last-by table.- Specified by:
replayGroupedLastBy
in interfaceReplayerInterface
- Parameters:
dataSource
- historical table to replaytimeColumn
- column in the table containing timestampsgroupColumn
- columns used as the key in computing last-by- Returns:
- dynamic, replayed version of the last-by table.
- Throws:
IOException
-
getHandle
Description copied from interface:ReplayerInterface
Gets a handle to the replayer.- Specified by:
getHandle
in interfaceReplayerInterface
- Returns:
- handle to the replayer.
-
replayGroupedLastBy
public Table replayGroupedLastBy(Table dataSource, String timeColumn, String groupColumn) throws IOException- Throws:
IOException
-
shutdown
Description copied from interface:ReplayerInterface
Shuts down the replayer.- Specified by:
shutdown
in interfaceReplayerInterface
- Throws:
IOException
- problem shutting down the replayer.
-
waitDone
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 interfaceReplayerInterface
- Parameters:
maxTimeMillis
- maximum number of milliseconds to wait.- Throws:
IOException
- problems encountered
-
isDone
Description copied from interface:ReplayerInterface
Has the replayer finished replaying all data.- Specified by:
isDone
in interfaceReplayerInterface
- 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 interfaceReplayerInterface
- Parameters:
updatedTime
- new replay time.
-
schedule
Description copied from interface:ReplayerInterface
Schedule a task to execute.- Specified by:
schedule
in interfaceReplayerInterface
- Parameters:
flushTask
- task to executeminute
- delay in milliseconds before first executing the taskminute1
- frequency in milliseconds to execute the task.
-