W - BoundedWindow subclass used to represent the windows used.@Experimental(value=TRIGGER) public abstract class TimeTrigger<W extends BoundedWindow> extends Trigger.OnceTrigger<W>
Triggers fire.Trigger.MergeResult, Trigger.MergingTriggerInfo<W extends BoundedWindow>, Trigger.OnceTrigger<W extends BoundedWindow>, Trigger.OnElementContext, Trigger.OnMergeContext, Trigger.OnTimerContext, Trigger.TriggerContext, Trigger.TriggerInfo<W extends BoundedWindow>, Trigger.TriggerResult| Modifier and Type | Field and Description |
|---|---|
protected static StateTag<CombiningValueState<org.joda.time.Instant,org.joda.time.Instant>> |
DELAYED_UNTIL_TAG |
protected static List<SerializableFunction<org.joda.time.Instant,org.joda.time.Instant>> |
IDENTITY |
protected List<SerializableFunction<org.joda.time.Instant,org.joda.time.Instant>> |
timestampMappers
A list of timestampMappers m1, m2, m3, ...
|
subTriggers| Modifier | Constructor and Description |
|---|---|
protected |
TimeTrigger(List<SerializableFunction<org.joda.time.Instant,org.joda.time.Instant>> timestampMappers) |
| Modifier and Type | Method and Description |
|---|---|
TimeTrigger<W> |
alignedTo(org.joda.time.Duration size)
Aligns the time to be the smallest multiple of
size greater than the timestamp
since the epoch. |
TimeTrigger<W> |
alignedTo(org.joda.time.Duration size,
org.joda.time.Instant offset)
Aligns timestamps to the smallest multiple of
size since the offset greater
than the timestamp. |
protected org.joda.time.Instant |
computeTargetTimestamp(org.joda.time.Instant time) |
boolean |
isCompatible(Trigger<?> other)
Returns whether this performs the same triggering as the given
Trigger. |
TimeTrigger<W> |
mappedTo(SerializableFunction<org.joda.time.Instant,org.joda.time.Instant> timestampMapper)
Adjust the time at which the trigger will fire.
|
protected abstract TimeTrigger<W> |
newWith(List<SerializableFunction<org.joda.time.Instant,org.joda.time.Instant>> transform)
Method to create an updated version of this
TimeTrigger modified to use the specified
transform. |
TimeTrigger<W> |
plusDelayOf(org.joda.time.Duration delay)
Adds some delay to the original target time.
|
getContinuationTriggerclear, equals, getContinuationTrigger, getWatermarkThatGuaranteesFiring, hashCode, onElement, onMerge, onTimer, orFinally, prefetchOnElement, prefetchOnMerge, prefetchOnTimer, subTriggers, toStringprotected static final StateTag<CombiningValueState<org.joda.time.Instant,org.joda.time.Instant>> DELAYED_UNTIL_TAG
protected static final List<SerializableFunction<org.joda.time.Instant,org.joda.time.Instant>> IDENTITY
protected final List<SerializableFunction<org.joda.time.Instant,org.joda.time.Instant>> timestampMappers
protected TimeTrigger(List<SerializableFunction<org.joda.time.Instant,org.joda.time.Instant>> timestampMappers)
protected org.joda.time.Instant computeTargetTimestamp(org.joda.time.Instant time)
public TimeTrigger<W> plusDelayOf(org.joda.time.Duration delay)
delay - the delay to addpublic TimeTrigger<W> alignedTo(org.joda.time.Duration size, org.joda.time.Instant offset)
size since the offset greater
than the timestamp.
TODO: Consider sharing this with FixedWindows, and bring over the equivalent of CalendarWindows.
public TimeTrigger<W> alignedTo(org.joda.time.Duration size)
size greater than the timestamp
since the epoch.public TimeTrigger<W> mappedTo(SerializableFunction<org.joda.time.Instant,org.joda.time.Instant> timestampMapper)
The timestampMapper function must have the following properties for all values
a and b:
a = b then timestampMapper(a) = timestampMapper(b)
a < b then timestampMapper(a) <= timestampMapper(b)
timestampMapper - Function that will be invoked on the proposed trigger time to determine
the time at which the trigger should actually fire.public boolean isCompatible(Trigger<?> other)
TriggerTrigger.isCompatible in class Trigger<W extends BoundedWindow>protected abstract TimeTrigger<W> newWith(List<SerializableFunction<org.joda.time.Instant,org.joda.time.Instant>> transform)
TimeTrigger modified to use the specified
transform.transform - The new transform to apply to target times.TimeTrigger.