Enum StreamWindowEvent.Type
- java.lang.Object
-
- java.lang.Enum<StreamWindowEvent.Type>
-
- com.ibm.streams.operator.window.StreamWindowEvent.Type
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<StreamWindowEvent.Type>
- Enclosing class:
- StreamWindowEvent<T>
public static enum StreamWindowEvent.Type extends java.lang.Enum<StreamWindowEvent.Type>
Stream window event type.
-
-
Enum Constant Summary
Enum Constants Enum Constant and Description EVICTION
Eviction of tuples from the window.FINAL
Final punctuation event.INITIAL_FULL
Event that signifies a sliding window has reached its initial window full event.INSERTION
Insertion of tuples into a window.PARTITION_EVICTION
Eviction of a partition and its tuples from a partitioned window.TRIGGER
Trigger of a sliding window.
-
Method Summary
Methods Modifier and Type Method and Description static StreamWindowEvent.Type
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static StreamWindowEvent.Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSERTION
public static final StreamWindowEvent.Type INSERTION
Insertion of tuples into a window. Listeners typically perform incremental state maintenance based upon the incoming tuples attribute values.
-
EVICTION
public static final StreamWindowEvent.Type EVICTION
Eviction of tuples from the window. Tuples are evicted from the window according to the eviction policy of the window.For a tumbling window all tuples are evicted as follows:
- For a count-based eviction policy all tuples are evicted after
the insertion of the N'th tuple where N is the size of the window.
The
INSERTION
event precedes theEVICTION
event. - For a time-based eviction policy all tuple are evicted every T seconds independent of tuple arrival at the port, where T is the time period. The first eviction will take place T seconds after the SPL runtime has notified the operator of port readiness, that is T seconds after the call to Operator.allPortsReady() is made. Note the timer will start at the time allPortsReady() is called, not at the point the Operator's implementation returns control to the SPL runtime.
- For an attribute delta based policy, when a new tuple is received,
if the delta between its eviction policy attribute value and that of the
oldest tuple in the window is larger than the eviction policy size,
then all tuples are evicted. The
EVICTION
event occurs before theINSERTION
event. - For a punctuation-based eviction policy all tuples are evicted
when a
WINDOW_MARKER
punctuation mark arrives.
Note that for a tumbling window anEVICTION
event will occur even if the window logically contained zero tuples or if the window contained tuples but no Tuple references were maintained due to their removal during event processing.For a sliding window tuples are evicted as follows:
- For a count-based eviction policy, once the window contains N
logical tuples the arrival of a tuple on the window's input port will
result in the eviction of the oldest logical tuple in the window.
The
EVICTION
event precedes theINSERTION
event. - For a time-based eviction policy, tuples that have been in the window more than T seconds are evicted. Eviction is independent of insertion.
- For an attribute delta based policy, the size defines the boundary
of the window, as it slides, in the units of the eviction policy attribute.
When a new tuple is received, existing tuples in the window for which the
delta between the eviction policy attribute value of the new tuple and
that of the existing tuple is greater than the eviction policy size,
are evicted.
The
EVICTION
event precedes theINSERTION
event.
For a sliding window anEVICTION
event that would contain an empty Iterable is not made. This reduces overhead of empty calls for window handers that do not need to be notified of evictions, or where the state of the window did not change. - For a count-based eviction policy all tuples are evicted after
the insertion of the N'th tuple where N is the size of the window.
The
-
TRIGGER
public static final StreamWindowEvent.Type TRIGGER
Trigger of a sliding window. Trigger events occur according to the trigger policy of the sliding window.- For a count-based trigger policy of size N the trigger
fires after N tuples have been logically inserted since the last trigger
was fired, or since the window was created for the first trigger firing.
The
INSERTION
event precedes theTRIGGER
event. - For a time-based trigger policy the trigger fires every T seconds independent of tuple arrival at the port, where T is the time period of the policy. The first trigger will take place T seconds after the SPL runtime has notified the operator of port readiness, that is T seconds after the call to Operator.allPortsReady() is made. Note the timer will start at the time allPortsReady() is called, not at the point the Operator's implementation returns control to the SPL runtime.
- For an attribute delta based trigger policy, the size defines the
boundary of the sequence of tuples since the last trigger, that trigger
the window again. When a new tuple is received, if the value of its trigger
attribute is larger than that of the last tuple which triggered the window
plus the trigger policy size, the window is triggered again.
The
TRIGGER
event occurs before anyEVICTION
event when the window has a count or delta based eviction policy, and thus also precedes theINSERTION
event.
- For a count-based trigger policy of size N the trigger
fires after N tuples have been logically inserted since the last trigger
was fired, or since the window was created for the first trigger firing.
The
-
INITIAL_FULL
public static final StreamWindowEvent.Type INITIAL_FULL
Event that signifies a sliding window has reached its initial window full event. The initial window full event only occurs for a sliding window, it allows window handlers to delay any actions until the window has been full at least once. The initial window full event timing depends upon the window's eviction policy.- For a count-based eviction policy of size N the window is initially full
after the insertion of the N'th tuple.
The
INSERTION
event precedes theINITIAL_FULL
event, and theINITIAL_FULL
precedes any count-based policyTRIGGER
event due to theINSERTION
. When the window is partitioned each partition will receive aINITIAL_FULL
event once it has had N tuples inserted into it. - For a time-based eviction policy the
INITIAL_FULL
event will take place once SPL runtime has notified the operator of port readiness, that is the window starts out as full. When the window is partitioned, partitions created after the all ports ready notification will receive aINITIAL_FULL
event when they are created. TheINITIAL_FULL
event precedes the theINSERTION
event that caused the partition to be created. - For an attribute delta-based eviction policy, the window is initially
full when delta between the first tuple in the window
and the tuple being inserted exceeds the policy size for the defined
attribute. The
INITIAL_FULL
event precedes theEVICTION
andINSERTION
events that triggered the initial full state. When the window is partitioned each partition will receive aINITIAL_FULL
event independently driven by deltas between the first tuple in each partition and arriving tuples.
If a partition is evicted (@link StreamWindow#evictPartition(Object)} then subsequent insertion of tuples with the same partition value act as a new partition, leading to another
INITIAL_FULL
event according to the eviction policy. - For a count-based eviction policy of size N the window is initially full
after the insertion of the N'th tuple.
The
-
FINAL
public static final StreamWindowEvent.Type FINAL
Final punctuation event. The final punctuation occurs when theFINAL_MARKER
is received by the input port, signifying that no more tuples or punctuation marks will arrive. Handling of the event will typically perform final actions based upon the remaining tuples in the window.
Note that aFINAL
event will be generated for each active window partition when the window is partitioned.
-
PARTITION_EVICTION
public static final StreamWindowEvent.Type PARTITION_EVICTION
Eviction of a partition and its tuples from a partitioned window.When a partition eviction is defined by the SPL invocation of the operator, partitions will be evicted according to the partition eviction policy. Partitions are always evicted oldest first, with the order defined by
StreamWindow.getPartitions()
. An empty partition is one that has no tuples according to its window eviction policy, e.g. aTIME
policyTUMBLING
window that has anEVICTION
event, but no subsequentINSERTION
event.-
partitionCount(N)
If after anINSERTION
event the number of partitions is greater thanN
then the oldest empty partitions are evicted up to the oldest non-empty partition. The oldest non-empty partition will then be evicted if the partition count is greater thanN
. -
tupleCount(N)
If after anINSERTION
event the total number of tuples in all partitions is greater thanN
then the oldest partitions (empty and non-empty) are evicted until the tuple count is less than or equal toN
. -
partitionAge(T)
Any partitions that have not had a tuple inserted into them in the lastT
seconds are evicted. Partition eviction is independent of tuple insertion.
partitionCount(N)
andtupleCount(N)
if at least one partition is evicted then additionally all empty old partitions up to (but not including) the first non-empty partition partition are evicted. A partition is empty if it logically has no tuples in it according to its window configuration. An implementation ofStreamWindowListener
may call theStreamWindow.needsPartitionEviction()
to determine if partition eviction after anINSERTION
event will occur. If the listener evicts sufficient partitions (untilneedsPartitionEviction()
returns false) during handling of theINSERTION
event, then no additional partitions will be evicted automatically.- Since:
- InfoSphere® Streams Version 2.0.0.3
-
-
-
Method Detail
-
values
public static StreamWindowEvent.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (StreamWindowEvent.Type c : StreamWindowEvent.Type.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StreamWindowEvent.Type valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-