Class BaseWindowedBolt

    • Constructor Detail

      • BaseWindowedBolt

        protected BaseWindowedBolt()
    • Method Detail

      • withWindow

        public BaseWindowedBolt withWindow​(BaseWindowedBolt.Count windowLength,
                                           BaseWindowedBolt.Count slidingInterval)
        Tuple count based sliding window configuration.
        Parameters:
        windowLength - the number of tuples in the window
        slidingInterval - the number of tuples after which the window slides
      • withWindow

        public BaseWindowedBolt withWindow​(BaseWindowedBolt.Count windowLength,
                                           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
      • withWindow

        public BaseWindowedBolt withWindow​(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
      • withWindow

        public BaseWindowedBolt withWindow​(Duration windowLength,
                                           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
      • withWindow

        public BaseWindowedBolt withWindow​(BaseWindowedBolt.Count windowLength)
        A tuple count based window that slides with every incoming tuple.
        Parameters:
        windowLength - the number of tuples in the window
      • withWindow

        public BaseWindowedBolt withWindow​(Duration windowLength)
        A time duration based window that slides with every incoming tuple.
        Parameters:
        windowLength - the time duration of the window
      • withTumblingWindow

        public BaseWindowedBolt withTumblingWindow​(BaseWindowedBolt.Count count)
        A count based tumbling window.
        Parameters:
        count - the number of tuples after which the window tumbles
      • withTumblingWindow

        public BaseWindowedBolt withTumblingWindow​(Duration duration)
        A time duration based tumbling window.
        Parameters:
        duration - the time duration after which the window tumbles
      • withTimestampField

        public BaseWindowedBolt withTimestampField​(String fieldName)
        Specify a field in the tuple that represents the timestamp as a long value. The timestamp should also be in milliseconds. If this field is not present in the incoming tuple, an IllegalArgumentException will be thrown.
        Parameters:
        fieldName - the name of the field that contains the timestamp
      • withLag

        public BaseWindowedBolt withLag​(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.
        Parameters:
        duration - the max lag duration
      • withWatermarkInterval

        public BaseWindowedBolt withWatermarkInterval​(Duration interval)
        Specify the watermark event generation interval. For tuple based timestamps, watermark events are used to track the progress of time
        Parameters:
        interval - the interval at which watermark events are generated
      • withCustomEvictor

        public BaseWindowedBolt withCustomEvictor​(EvictionPolicy<Tuple,​?> evictionPolicy)
        Sets a custom eviction policy to use for this bolt
        Parameters:
        evictionPolicy - the eviction policy to use
        Returns:
        this
      • withCustomTrigger

        public BaseWindowedBolt withCustomTrigger​(TriggerPolicy<Tuple,​?> triggerPolicy)
        Sets a custom trigger policy to use for this bolt
        Parameters:
        triggerPolicy - the trigger policy to use
        Returns:
        this
      • declareOutputFields

        public void declareOutputFields​(OutputFieldsDeclarer declarer)
        Description copied from interface: IComponent
        Declare the output schema for all the streams of this topology.
        Specified by:
        declareOutputFields in interface IComponent
        Parameters:
        declarer - this is used to declare output stream ids, output fields, and whether or not each output stream is a direct stream
      • getComponentConfiguration

        public Map<String,​Object> getComponentConfiguration()
        Description copied from interface: IComponent
        Declare configuration specific to this component. Only a subset of the "topology.*" configs can be overridden. The component configuration can be further overridden when constructing the topology using TopologyBuilder
        Specified by:
        getComponentConfiguration in interface IComponent