Class StreamWindowEvent<T>
- java.lang.Object
-
- java.util.EventObject
-
- com.ibm.streams.operator.window.StreamWindowEvent<T>
-
- Type Parameters:
T
- Tuple type.
- All Implemented Interfaces:
- java.io.Serializable
public class StreamWindowEvent<T> extends java.util.EventObject
An event for a windowed input port.
The source of the event (getSource()
) is theStreamWindow
for the window.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
StreamWindowEvent.Type
Stream window event type.
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
IBM_COPYRIGHT
-
Constructor Summary
Constructors Constructor and Description StreamWindowEvent(StreamWindowEvent.Type type, StreamWindow<T> window, java.lang.Object partition, java.lang.Iterable<T> tuples)
-
Method Summary
Methods Modifier and Type Method and Description java.lang.Object
getPartition()
The partition the event is for.java.lang.Iterable<T>
getTuples()
A sequence of tuples in arrival order, from oldest to most recent.StreamWindowEvent.Type
getType()
The type of the event.
-
-
-
Field Detail
-
IBM_COPYRIGHT
public static final java.lang.String IBM_COPYRIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StreamWindowEvent
public StreamWindowEvent(StreamWindowEvent.Type type, StreamWindow<T> window, java.lang.Object partition, java.lang.Iterable<T> tuples)
-
-
Method Detail
-
getPartition
public final java.lang.Object getPartition()
The partition the event is for. When a window is partitioned the returned value will be the result of executing theregistered
StreamWindowPartitioner
against a tuple.
When a window is not partitioned all events will return ajava.lang.Integer
with value zero.- Returns:
- the partition
-
getType
public final StreamWindowEvent.Type getType()
The type of the event.- Returns:
- Type of this event
-
getTuples
public final java.lang.Iterable<T> getTuples()
A sequence of tuples in arrival order, from oldest to most recent.For an
INSERTION
event the sequence represents the tuples being inserted into a window. Multiple tuple arrivals may be batched into a singleINSERTION
event, thus a listener should never assume the event only contains a single tuple.
For anEVICTION
event the sequence represents the sub-set of tuples being evicted from a window that have a reference to their tuple instance. Multiple tuple evictions may be batched into a single EVICITON event, thus a listener should never assume the event only contains a single tuple.
For all other event types the collection represents sub-set of logical tuples currently in the window that have a reference to their tuple instance.Executing
Iterator.remove()
for a tuple will result in the tuple reference being removed from the window to allow garbage collection of the tuple object (by not having theStreamWindow
implementation hold its reference). The tuple logically remains in the window but its attribute values are no longer available through instances ofStreamWindowEvent
.
-
-