com.ibm.streams.operator.window

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 the StreamWindow 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 
      • Fields inherited from class java.util.EventObject

        source
    • 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.
      • Methods inherited from class java.util.EventObject

        getSource, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 the registered StreamWindowPartitioner against a tuple.
        When a window is not partitioned all events will return a java.lang.Integer with value zero.
        Returns:
        the partition
      • 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 single INSERTION event, thus a listener should never assume the event only contains a single tuple.
        For an EVICTION 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 the StreamWindow implementation hold its reference). The tuple logically remains in the window but its attribute values are no longer available through instances of StreamWindowEvent.