Class SlidingWindows<L,I> 
java.lang.Object
org.apache.storm.streams.windowing.BaseWindow<L,I>
 
org.apache.storm.streams.windowing.SlidingWindows<L,I> 
- Type Parameters:
- L- The type of the window length (e.g. Duration or Count)
- I- The type of the sliding interval (e.g. Duration or Count)
- All Implemented Interfaces:
- Serializable,- Window<L,- I> 
A sliding window specification based on a window length and sliding interval.
- See Also:
- 
Field SummaryFields inherited from class org.apache.storm.streams.windowing.BaseWindowlag, lateTupleStream, timestampField
- 
Method SummaryModifier and TypeMethodDescriptionbooleanThe sliding interval of the window.The length of the window.inthashCode()of(BaseWindowedBolt.Count windowLength, BaseWindowedBolt.Count slidingInterval) Count based sliding window configuration.of(BaseWindowedBolt.Count windowLength, BaseWindowedBolt.Duration slidingInterval) Tuple count and time duration based sliding window configuration.of(BaseWindowedBolt.Duration windowLength, BaseWindowedBolt.Count slidingInterval) Time duration and count based sliding window configuration.of(BaseWindowedBolt.Duration windowLength, BaseWindowedBolt.Duration slidingInterval) Time duration based sliding window configuration.withLag(BaseWindowedBolt.Duration duration) Specify the maximum time lag of the tuple timestamp in milliseconds.withLateTupleStream(String streamId) Specify a stream id on which late tuples are going to be emitted.withTimestampField(String fieldName) The name of the field in the tuple that contains the timestamp when the event occurred as a long value.Methods inherited from class org.apache.storm.streams.windowing.BaseWindowgetLag, getLateTupleStream, getTimestampField
- 
Method Details- 
ofpublic static SlidingWindows<BaseWindowedBolt.Count,BaseWindowedBolt.Count> of(BaseWindowedBolt.Count windowLength, BaseWindowedBolt.Count slidingInterval) Count based sliding window configuration.- Parameters:
- windowLength- the number of tuples in the window
- slidingInterval- the number of tuples after which the window slides
 
- 
ofpublic static SlidingWindows<BaseWindowedBolt.Duration,BaseWindowedBolt.Duration> of(BaseWindowedBolt.Duration windowLength, BaseWindowedBolt.Duration slidingInterval) Time duration based sliding window configuration.- Parameters:
- windowLength- the time duration of the window
- slidingInterval- the time duration after which the window slides
 
- 
ofpublic static SlidingWindows<BaseWindowedBolt.Count,BaseWindowedBolt.Duration> of(BaseWindowedBolt.Count windowLength, BaseWindowedBolt.Duration slidingInterval) Tuple count and time duration based sliding window configuration.- Parameters:
- windowLength- the number of tuples in the window
- slidingInterval- the time duration after which the window slides
 
- 
ofpublic static SlidingWindows<BaseWindowedBolt.Duration,BaseWindowedBolt.Count> of(BaseWindowedBolt.Duration windowLength, BaseWindowedBolt.Count slidingInterval) Time duration and count based sliding window configuration.- Parameters:
- windowLength- the time duration of the window
- slidingInterval- the number of tuples after which the window slides
 
- 
getWindowLengthThe length of the window.- Returns:
- the window length
 
- 
getSlidingIntervalThe sliding interval of the window.- Returns:
- the sliding interval
 
- 
withTimestampFieldThe name of the field in the tuple that contains the timestamp when the event occurred as a long value. This is used of event-time based processing. If this config is set and the field is not present in the incoming tuple, anIllegalArgumentExceptionwill be thrown.- Parameters:
- fieldName- the name of the field that contains the timestamp
 
- 
withLateTupleStreamSpecify a stream id on which late tuples are going to be emitted. They are going to be accessible via theWindowedBoltExecutor.LATE_TUPLE_FIELDfield. It must be defined on a per-component basis, and in conjunction with theBaseWindowedBolt.withTimestampField(java.lang.String), otherwiseIllegalArgumentExceptionwill be thrown.- Parameters:
- streamId- the name of the stream used to emit late tuples on
 
- 
withLagSpecify the maximum time lag of the tuple timestamp in milliseconds. It means that the tuple timestamps cannot be out of order by more than this amount.- Parameters:
- duration- the max lag duration
 
- 
equals- Overrides:
- equalsin class- BaseWindow<L,- I> 
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- BaseWindow<L,- I> 
 
 
-