public class TupleWindowImpl extends Object implements TupleWindow
Holds the expired, new and current tuples in a window.
Constructor and Description |
---|
TupleWindowImpl(List<Tuple> tuples,
List<Tuple> newTuples,
List<Tuple> expiredTuples) |
TupleWindowImpl(List<Tuple> tuples,
List<Tuple> newTuples,
List<Tuple> expiredTuples,
Long startTimestamp,
Long endTimestamp) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
List<Tuple> |
get()
Gets the list of events in the window.
|
Long |
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.
|
List<Tuple> |
getExpired()
Get the list of events expired from the window since the last time the window was generated.
|
List<Tuple> |
getNew()
Get the list of newly added events in the window since the last time the window was generated.
|
Long |
getStartTimestamp()
Returns the window start timestamp.
|
int |
hashCode() |
String |
toString() |
public TupleWindowImpl(List<Tuple> tuples, List<Tuple> newTuples, List<Tuple> expiredTuples)
public List<Tuple> get()
Window
Gets the list of events in the window.
Note: If the number of tuples in windows is huge, invoking get
would load all the tuples into memory and may throw an OOM exception. Use windowing with persistence (BaseStatefulWindowedBolt.withPersistence()
) and Window.getIter()
to retrieve an iterator over the events in the window.
public List<Tuple> getNew()
Window
Get 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()
).
public List<Tuple> getExpired()
Window
Get 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()
).
getExpired
in interface Window<Tuple>
public Long getStartTimestamp()
Window
Returns the window start timestamp. Will return null if the window length is not based on time duration.
getStartTimestamp
in interface Window<Tuple>
public Long getEndTimestamp()
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.
getEndTimestamp
in interface Window<Tuple>
Copyright © 2022 The Apache Software Foundation. All rights reserved.