public abstract class BaseStatefulWindowedBolt<T extends State> extends BaseWindowedBolt implements IStatefulWindowedBolt<T>
BaseWindowedBolt.Count, BaseWindowedBolt.DurationtimestampExtractor, windowConfiguration| Constructor and Description |
|---|
BaseStatefulWindowedBolt() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isPersistent()
If the stateful windowed bolt should have its windows persisted in state and maintain a subset of events in memory.
|
long |
maxEventsInMemory()
The maximum number of window events to keep in memory.
|
void |
preCommit(long txid)
This is a hook for the component to perform some actions just before the framework commits its state.
|
void |
prePrepare(long txid)
This is a hook for the component to perform some actions just before the framework prepares its state.
|
void |
preRollback()
This is a hook for the component to perform some actions just before the framework rolls back the prepared state.
|
BaseStatefulWindowedBolt<T> |
withLag(BaseWindowedBolt.Duration duration)
Specify the maximum time lag of the tuple timestamp in milliseconds.
|
BaseStatefulWindowedBolt<T> |
withLateTupleStream(String streamName)
Specify a stream id on which late tuples are going to be emitted.
|
BaseStatefulWindowedBolt<T> |
withMaxEventsInMemory(long maxEventsInMemory)
The maximum number of window events to keep in memory.
|
BaseStatefulWindowedBolt<T> |
withMessageIdField(String fieldName)
Specify the name of the field in the tuple that holds the message id.
|
BaseStatefulWindowedBolt<T> |
withPersistence()
If set, the stateful windowed bolt would use the backend state for window persistence and only keep a sub-set of events in memory as
specified by
withMaxEventsInMemory(long). |
BaseStatefulWindowedBolt<T> |
withTimestampExtractor(TimestampExtractor timestampExtractor)
Specify the timestamp extractor implementation.
|
BaseStatefulWindowedBolt<T> |
withTimestampField(String fieldName)
Specify a field in the tuple that represents the timestamp as a long value.
|
BaseStatefulWindowedBolt<T> |
withTumblingWindow(BaseWindowedBolt.Count count)
A count based tumbling window.
|
BaseStatefulWindowedBolt<T> |
withTumblingWindow(BaseWindowedBolt.Duration duration)
A time duration based tumbling window.
|
BaseStatefulWindowedBolt<T> |
withWatermarkInterval(BaseWindowedBolt.Duration interval)
Specify the watermark event generation interval.
|
BaseStatefulWindowedBolt<T> |
withWindow(BaseWindowedBolt.Count windowLength)
A tuple count based window that slides with every incoming tuple.
|
BaseStatefulWindowedBolt<T> |
withWindow(BaseWindowedBolt.Count windowLength,
BaseWindowedBolt.Count slidingInterval)
Tuple count based sliding window configuration.
|
BaseStatefulWindowedBolt<T> |
withWindow(BaseWindowedBolt.Count windowLength,
BaseWindowedBolt.Duration slidingInterval)
Tuple count and time duration based sliding window configuration.
|
BaseStatefulWindowedBolt<T> |
withWindow(BaseWindowedBolt.Duration windowLength)
A time duration based window that slides with every incoming tuple.
|
BaseStatefulWindowedBolt<T> |
withWindow(BaseWindowedBolt.Duration windowLength,
BaseWindowedBolt.Count slidingInterval)
Time duration and count based sliding window configuration.
|
BaseStatefulWindowedBolt<T> |
withWindow(BaseWindowedBolt.Duration windowLength,
BaseWindowedBolt.Duration slidingInterval)
Time duration based sliding window configuration.
|
cleanup, declareOutputFields, getComponentConfiguration, getTimestampExtractor, prepareclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitStatecleanup, execute, getTimestampExtractor, preparedeclareOutputFields, getComponentConfigurationpublic BaseStatefulWindowedBolt<T> withWindow(BaseWindowedBolt.Count windowLength, BaseWindowedBolt.Count slidingInterval)
withWindow in class BaseWindowedBoltwindowLength - the number of tuples in the windowslidingInterval - the number of tuples after which the window slidespublic BaseStatefulWindowedBolt<T> withWindow(BaseWindowedBolt.Count windowLength, BaseWindowedBolt.Duration slidingInterval)
withWindow in class BaseWindowedBoltwindowLength - the number of tuples in the windowslidingInterval - the time duration after which the window slidespublic BaseStatefulWindowedBolt<T> withWindow(BaseWindowedBolt.Duration windowLength, BaseWindowedBolt.Count slidingInterval)
withWindow in class BaseWindowedBoltwindowLength - the time duration of the windowslidingInterval - the number of tuples after which the window slidespublic BaseStatefulWindowedBolt<T> withWindow(BaseWindowedBolt.Duration windowLength, BaseWindowedBolt.Duration slidingInterval)
withWindow in class BaseWindowedBoltwindowLength - the time duration of the windowslidingInterval - the time duration after which the window slidespublic BaseStatefulWindowedBolt<T> withWindow(BaseWindowedBolt.Count windowLength)
withWindow in class BaseWindowedBoltwindowLength - the number of tuples in the windowpublic BaseStatefulWindowedBolt<T> withWindow(BaseWindowedBolt.Duration windowLength)
withWindow in class BaseWindowedBoltwindowLength - the time duration of the windowpublic BaseStatefulWindowedBolt<T> withTumblingWindow(BaseWindowedBolt.Count count)
withTumblingWindow in class BaseWindowedBoltcount - the number of tuples after which the window tumblespublic BaseStatefulWindowedBolt<T> withTumblingWindow(BaseWindowedBolt.Duration duration)
withTumblingWindow in class BaseWindowedBoltduration - the time duration after which the window tumblespublic BaseStatefulWindowedBolt<T> withTimestampField(String fieldName)
IllegalArgumentException will be thrown. The field MUST contain a timestamp in millisecondswithTimestampField in class BaseWindowedBoltfieldName - the name of the field that contains the timestamppublic BaseStatefulWindowedBolt<T> withTimestampExtractor(TimestampExtractor timestampExtractor)
withTimestampExtractor in class BaseWindowedBolttimestampExtractor - the TimestampExtractor implementationpublic BaseStatefulWindowedBolt<T> withLateTupleStream(String streamName)
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.withLateTupleStream in class BaseWindowedBoltstreamName - the name of the stream used to emit late tuples onpublic BaseStatefulWindowedBolt<T> withLag(BaseWindowedBolt.Duration duration)
withLag in class BaseWindowedBoltduration - the max lag durationpublic BaseStatefulWindowedBolt<T> withWatermarkInterval(BaseWindowedBolt.Duration interval)
withWatermarkInterval in class BaseWindowedBoltinterval - the interval at which watermark events are generatedpublic BaseStatefulWindowedBolt<T> withMessageIdField(String fieldName)
fieldName - the name of the field that contains the message idpublic BaseStatefulWindowedBolt<T> withPersistence()
withMaxEventsInMemory(long).public BaseStatefulWindowedBolt<T> withMaxEventsInMemory(long maxEventsInMemory)
withPersistence() is also set. As the
number of events in memory grows close to the maximum, the events that are less likely to be used again are evicted and persisted.
The default value for this is 1,000,000.maxEventsInMemory - the maximum number of window events to keep in memorypublic boolean isPersistent()
IStatefulWindowedBoltThe default is to keep all the window events in memory.
isPersistent in interface IStatefulWindowedBolt<T extends State>public long maxEventsInMemory()
IStatefulWindowedBoltmaxEventsInMemory in interface IStatefulWindowedBolt<T extends State>public void preCommit(long txid)
IStatefulComponentpreCommit in interface IStatefulComponent<T extends State>public void prePrepare(long txid)
IStatefulComponentprePrepare in interface IStatefulComponent<T extends State>public void preRollback()
IStatefulComponentpreRollback in interface IStatefulComponent<T extends State>Copyright © 2023 The Apache Software Foundation. All rights reserved.