Interface TimeReservoir<V>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      UniformTimeSnapshot getSnapshot​(long time, java.util.concurrent.TimeUnit timeUnit)
      Returns a snapshot of the reservoir's values at given time or newer.
      long interval​(java.util.concurrent.TimeUnit timeUnit)
      The time interval this reservoir stores data of.
      int size​(long time, java.util.concurrent.TimeUnit timeUnit)
      Returns the number of values recorded at given time or newer.
      void update​(V value, long time, java.util.concurrent.TimeUnit timeUnit)
      Adds a new recorded value to the reservoir bound to a given time.
    • Method Detail

      • size

        int size​(long time,
                 java.util.concurrent.TimeUnit timeUnit)
        Returns the number of values recorded at given time or newer. It may not be supported to return a size in past due to performance optimizations.
        Parameters:
        time - The time to get the size for
        timeUnit - Time unit of the provided time
        Returns:
        the number of values recorded for given time or newer
      • update

        void update​(V value,
                    long time,
                    java.util.concurrent.TimeUnit timeUnit)
        Adds a new recorded value to the reservoir bound to a given time.
        Parameters:
        value - a new recorded value
        time - The time the recorded value occurred at
        timeUnit - Time unit of the provided time
      • getSnapshot

        UniformTimeSnapshot getSnapshot​(long time,
                                        java.util.concurrent.TimeUnit timeUnit)
        Returns a snapshot of the reservoir's values at given time or newer. It may not be supported to return a snapshot in past due to performance optimizations.
        Parameters:
        time - The time for which to get the snapshot
        timeUnit - Time unit of the provided time
        Returns:
        a snapshot of the reservoir's values for given time or newer
      • interval

        long interval​(java.util.concurrent.TimeUnit timeUnit)
        The time interval this reservoir stores data of.
        Parameters:
        timeUnit - The time unit in which to get the interval
        Returns:
        The time interval of this time reservoir