Class Windows<W extends Window>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int segments  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Windows()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      long maintainMs()
      Return the window maintain duration (retention time) in milliseconds.
      protected Windows<W> segments​(int segments)
      Set the number of segments to be used for rolling the window store.
      abstract long size()
      Return the size of the specified windows in milliseconds.
      Windows<W> until​(long durationMs)
      Set the window maintain duration (retention time) in milliseconds.
      abstract java.util.Map<java.lang.Long,​W> windowsFor​(long timestamp)
      Create all windows that contain the provided timestamp, indexed by non-negative window start timestamps.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • segments

        public int segments
    • Constructor Detail

      • Windows

        protected Windows()
    • Method Detail

      • until

        public Windows<W> until​(long durationMs)
                         throws java.lang.IllegalArgumentException
        Set the window maintain duration (retention time) in milliseconds. This retention time is a guaranteed lower bound for how long a window will be maintained.
        Parameters:
        durationMs - the window retention time in milliseconds
        Returns:
        itself
        Throws:
        java.lang.IllegalArgumentException - if durationMs is negative
      • maintainMs

        public long maintainMs()
        Return the window maintain duration (retention time) in milliseconds.
        Returns:
        the window maintain duration
      • segments

        protected Windows<W> segments​(int segments)
                               throws java.lang.IllegalArgumentException
        Set the number of segments to be used for rolling the window store. This function is not exposed to users but can be called by developers that extend this class.
        Parameters:
        segments - the number of segments to be used
        Returns:
        itself
        Throws:
        java.lang.IllegalArgumentException - if specified segments is small than 2
      • windowsFor

        public abstract java.util.Map<java.lang.Long,​W> windowsFor​(long timestamp)
        Create all windows that contain the provided timestamp, indexed by non-negative window start timestamps.
        Parameters:
        timestamp - the timestamp window should get created for
        Returns:
        a map of windowStartTimestamp -> Window entries
      • size

        public abstract long size()
        Return the size of the specified windows in milliseconds.
        Returns:
        the size of the specified windows