DATA - The type of the incoming data points which are processed by this
policy.public class TimeTriggerPolicy<DATA> extends Object implements ActiveTriggerPolicy<DATA>, CloneableTriggerPolicy<DATA>, CentralActiveTrigger<DATA>
Timestamp implementation. A point in time is always represented
as long. Therefore, parameters such as granularity and delay can be set as
long value as well.| Modifier and Type | Field and Description |
|---|---|
long |
granularity |
protected long |
startTime |
TimestampWrapper<DATA> |
timestampWrapper |
| Constructor and Description |
|---|
TimeTriggerPolicy(long granularity,
TimestampWrapper<DATA> timestampWrapper)
This is mostly the same as
TimeTriggerPolicy(long, TimestampWrapper). |
| Modifier and Type | Method and Description |
|---|---|
Object |
activeFakeElementEmission(ActiveTriggerCallback callback)
This method is only called in case the runnable triggers a window end
according to the
SystemTimestamp. |
TimeTriggerPolicy<DATA> |
clone()
This method should return an exact copy of the object it belongs to
including the current object state.
|
Runnable |
createActiveTriggerRunnable(ActiveTriggerCallback callback)
In case
SystemTimestamp is used, a runnable is returned which
triggers based on the current system time. |
boolean |
equals(Object other) |
long |
getSlideSize() |
TimestampWrapper<DATA> |
getTimeStampWrapper() |
Object[] |
notifyOnLastGlobalElement(DATA datapoint)
This method is called to broadcast information about the last globally
seen data point to all triggers.
|
boolean |
notifyTrigger(DATA datapoint)
Proves and returns if a new window should be started.
|
Object[] |
preNotifyTrigger(DATA datapoint)
This method checks if we missed a window end.
|
String |
toString() |
protected long startTime
public long granularity
public TimestampWrapper<DATA> timestampWrapper
public TimeTriggerPolicy(long granularity,
TimestampWrapper<DATA> timestampWrapper)
TimeTriggerPolicy(long, TimestampWrapper). In addition
to granularity and timestamp a delay can be specified for the first
trigger. If the start time given by the timestamp is x, the delay is y,
and the granularity is z, the first trigger will happen at x+y+z.granularity - The granularity of the trigger. If this value is set to 2 the
policy will trigger at every second time pointtimestampWrapper - The TimestampWrapper to measure the time with. This
can be either user defined of provided by the API.public Object[] preNotifyTrigger(DATA datapoint)
preNotifyTrigger in interface ActiveTriggerPolicy<DATA>datapoint - the data point which arrived at the operatorpublic Runnable createActiveTriggerRunnable(ActiveTriggerCallback callback)
SystemTimestamp is used, a runnable is returned which
triggers based on the current system time. If any other time measure is
used the method returns null.createActiveTriggerRunnable in interface ActiveTriggerPolicy<DATA>callback - The object which is takes the callbacks for adding fake
elements out of the runnable.public Object activeFakeElementEmission(ActiveTriggerCallback callback)
SystemTimestamp.callback - The callback object.public boolean notifyTrigger(DATA datapoint)
TriggerPolicynotifyTrigger in interface TriggerPolicy<DATA>datapoint - the data point which arrivedpublic TimeTriggerPolicy<DATA> clone()
CloneableTriggerPolicyclone in interface CloneableTriggerPolicy<DATA>clone in class Objectpublic long getSlideSize()
public TimestampWrapper<DATA> getTimeStampWrapper()
public Object[] notifyOnLastGlobalElement(DATA datapoint)
CentralActiveTriggernotifyOnLastGlobalElement in interface CentralActiveTrigger<DATA>datapoint - The last globally seen dataCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.