public class EventTimeBasedMillisTimestampGenerator extends Object implements TimestampGenerator
Scheduler
whenever there is a new event with increased timestamp.
Also it can optionally send heart beat to the registered schedulers based
on the configuration provided.StreamJunction.sendData(long, Object[])| Modifier and Type | Class and Description |
|---|---|
static interface |
EventTimeBasedMillisTimestampGenerator.TimeChangeListener
Listener used to get notification when a new event comes in.
|
| Constructor and Description |
|---|
EventTimeBasedMillisTimestampGenerator(ScheduledExecutorService scheduledExecutorService)
Create an EventBasedTimeMillisTimestampGenerator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTimeChangeListener(EventTimeBasedMillisTimestampGenerator.TimeChangeListener listener)
Register to listen for time changes.
|
long |
currentTime()
Return the time of last event received by Siddhi or the time generated by internal clock after a delay
as defined in Playback annotation.
|
void |
setCurrentTimestamp(long timestamp)
Set the timestamp to the
EventTimeBasedMillisTimestampGenerator and notify the interested listeners. |
void |
setIdleTime(long idleTime)
The
ScheduledExecutorService waits until idleTime from the timestamp of last event
and if there are no new events arrived within that period, it will inject a new timestamp. |
void |
setIncrementInMilliseconds(long incrementInMilliseconds)
Set by how many milliseconds, the event timestamp should be increased.
|
public EventTimeBasedMillisTimestampGenerator(ScheduledExecutorService scheduledExecutorService)
scheduledExecutorService - the schedule service to be executed for produce heartbeat.public long currentTime()
currentTime in interface TimestampGeneratorpublic void setCurrentTimestamp(long timestamp)
EventTimeBasedMillisTimestampGenerator and notify the interested listeners.timestamp - the timestamp to the EventTimeBasedMillisTimestampGeneratorpublic void addTimeChangeListener(EventTimeBasedMillisTimestampGenerator.TimeChangeListener listener)
listener - any listeners interested on time change.Schedulerpublic void setIdleTime(long idleTime)
ScheduledExecutorService waits until idleTime from the timestamp of last event
and if there are no new events arrived within that period, it will inject a new timestamp.idleTime - the ideal time for wait until from the timestamp of last event.public void setIncrementInMilliseconds(long incrementInMilliseconds)
incrementInMilliseconds - the timestamp incremental value.Copyright © 2018 WSO2. All rights reserved.