public class SlidingWindows<L,I> extends BaseWindow<L,I>
A sliding window specification based on a window length and sliding interval.
lag, lateTupleStream, timestampField
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
I |
getSlidingInterval()
The sliding interval of the window.
|
L |
getWindowLength()
The length of the window.
|
int |
hashCode() |
static SlidingWindows<BaseWindowedBolt.Count,BaseWindowedBolt.Count> |
of(BaseWindowedBolt.Count windowLength,
BaseWindowedBolt.Count slidingInterval)
Count based sliding window configuration.
|
static SlidingWindows<BaseWindowedBolt.Count,BaseWindowedBolt.Duration> |
of(BaseWindowedBolt.Count windowLength,
BaseWindowedBolt.Duration slidingInterval)
Tuple count and time duration based sliding window configuration.
|
static SlidingWindows<BaseWindowedBolt.Duration,BaseWindowedBolt.Count> |
of(BaseWindowedBolt.Duration windowLength,
BaseWindowedBolt.Count slidingInterval)
Time duration and count based sliding window configuration.
|
static SlidingWindows<BaseWindowedBolt.Duration,BaseWindowedBolt.Duration> |
of(BaseWindowedBolt.Duration windowLength,
BaseWindowedBolt.Duration slidingInterval)
Time duration based sliding window configuration.
|
SlidingWindows<L,I> |
withLag(BaseWindowedBolt.Duration duration)
Specify the maximum time lag of the tuple timestamp in milliseconds.
|
SlidingWindows<L,I> |
withLateTupleStream(String streamId)
Specify a stream id on which late tuples are going to be emitted.
|
SlidingWindows<L,I> |
withTimestampField(String fieldName)
The name of the field in the tuple that contains the timestamp when the event occurred as a long value.
|
getLag, getLateTupleStream, getTimestampField
public static SlidingWindows<BaseWindowedBolt.Count,BaseWindowedBolt.Count> of(BaseWindowedBolt.Count windowLength, BaseWindowedBolt.Count slidingInterval)
Count based sliding window configuration.
windowLength
- the number of tuples in the windowslidingInterval
- the number of tuples after which the window slidespublic static SlidingWindows<BaseWindowedBolt.Duration,BaseWindowedBolt.Duration> of(BaseWindowedBolt.Duration windowLength, BaseWindowedBolt.Duration slidingInterval)
Time duration based sliding window configuration.
windowLength
- the time duration of the windowslidingInterval
- the time duration after which the window slidespublic static SlidingWindows<BaseWindowedBolt.Count,BaseWindowedBolt.Duration> of(BaseWindowedBolt.Count windowLength, BaseWindowedBolt.Duration slidingInterval)
Tuple count and time duration based sliding window configuration.
windowLength
- the number of tuples in the windowslidingInterval
- the time duration after which the window slidespublic static SlidingWindows<BaseWindowedBolt.Duration,BaseWindowedBolt.Count> of(BaseWindowedBolt.Duration windowLength, BaseWindowedBolt.Count slidingInterval)
Time duration and count based sliding window configuration.
windowLength
- the time duration of the windowslidingInterval
- the number of tuples after which the window slidespublic L getWindowLength()
The length of the window.
public I getSlidingInterval()
The sliding interval of the window.
public SlidingWindows<L,I> withTimestampField(String fieldName)
The 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, an IllegalArgumentException
will be thrown.
fieldName
- the name of the field that contains the timestamppublic SlidingWindows<L,I> withLateTupleStream(String streamId)
Specify a stream id on which late tuples are going to be emitted. They are going to be accessible via the WindowedBoltExecutor.LATE_TUPLE_FIELD
field. It must be defined on a per-component basis, and in conjunction with the BaseWindowedBolt.withTimestampField(java.lang.String)
, otherwise IllegalArgumentException
will be thrown.
streamId
- the name of the stream used to emit late tuples onpublic SlidingWindows<L,I> withLag(BaseWindowedBolt.Duration duration)
Specify 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.
duration
- the max lag durationpublic boolean equals(Object o)
equals
in class BaseWindow<L,I>
public int hashCode()
hashCode
in class BaseWindow<L,I>
Copyright © 2022 The Apache Software Foundation. All rights reserved.