Package org.apache.storm.windowing
Interface Window<T>
- Type Parameters:
- T- the type of event that this window contains. E.g.- Tuple
- All Known Subinterfaces:
- TupleWindow
- All Known Implementing Classes:
- TupleWindowImpl,- TupleWindowIterImpl
public interface Window<T>
A view of events in a sliding window.
- 
Method SummaryModifier and TypeMethodDescriptionget()Gets the list of events in the window.If processing based on event time, returns the window end time based on watermark otherwise returns the window end time based on processing time.Get the list of events expired from the window since the last time the window was generated.getIter()Returns an iterator over the events in the window.getNew()Get the list of newly added events in the window since the last time the window was generated.Returns the window start timestamp.
- 
Method Details- 
getGets the list of events in the window.Note: If the number of tuples in windows is huge, invoking getwould load all the tuples into memory and may throw an OOM exception. Use windowing with persistence (BaseStatefulWindowedBolt.withPersistence()) andgetIter()to retrieve an iterator over the events in the window.- Returns:
- the list of events in the window.
 
- 
getIterReturns an iterator over the events in the window.Note: This is only supported when using windowing with persistence BaseStatefulWindowedBolt.withPersistence().- Returns:
- an Iteratorover the events in the current window.
- Throws:
- UnsupportedOperationException- if not using- BaseStatefulWindowedBolt.withPersistence()
 
- 
getNewGet the list of newly added events in the window since the last time the window was generated.Note: This is not supported when using windowing with persistence ( BaseStatefulWindowedBolt.withPersistence()).- Returns:
- the list of newly added events in the window.
- Throws:
- UnsupportedOperationException- if using- BaseStatefulWindowedBolt.withPersistence()
 
- 
getExpiredGet the list of events expired from the window since the last time the window was generated.Note: This is not supported when using windowing with persistence ( BaseStatefulWindowedBolt.withPersistence()).- Returns:
- the list of events expired from the window.
- Throws:
- UnsupportedOperationException- if using- BaseStatefulWindowedBolt.withPersistence()
 
- 
getEndTimestampLong getEndTimestamp()If processing based on event time, returns the window end time based on watermark otherwise returns the window end time based on processing time.- Returns:
- the window end timestamp
 
- 
getStartTimestampLong getStartTimestamp()Returns the window start timestamp. Will return null if the window length is not based on time duration.- Returns:
- the window start timestamp or null if the window length is not time based
 
 
-