Class

org.apache.spark.sql.execution.Hokusai

TimeAggregation

Related Doc: package Hokusai

Permalink

class TimeAggregation extends AnyRef

Data Structures and Algorithms to maintain Time Aggregation from the paper. Time is modeled as a non-decreasing integer starting at 0.

The type parameter, T, is the key type. This needs to be numeric. Typical value is Long, but Short can cut down on size of resulting data structure, but increased chance of collision. BigInt is another possibility.

From Theorem 4 in the Paper:

At time t, the sketch Mj contains statistics for the period [t-delta, t-delta-2j] where delta = t mod 2^j

The following shows an example of how data ages through m() as t starts at 0 and increases:

=== t = 0
  t=0  j=0 m is EMPTY
=== t = 1
  t=1  j=0 m(0)=[0, 1) # secs in m(0): 1
=== t = 2
  t=2  j=0 m(0)=[1, 2) # secs in m(0): 1
  t=2  j=1 m(1)=[0, 2) # secs in m(1): 2
=== t = 3
  t=3  j=0 m(0)=[2, 3) # secs in m(0): 1
  t=3  j=1 m(1)=[0, 2) # secs in m(1): 2
=== t = 4
  t=4  j=0 m(0)=[3, 4) # secs in m(0): 1
  t=4  j=1 m(1)=[2, 4) # secs in m(1): 2
  t=4  j=2 m(2)=[0, 4) # secs in m(2): 4
=== t = 5
  t=5  j=0 m(0)=[4, 5) # secs in m(0): 1
  t=5  j=1 m(1)=[2, 4) # secs in m(1): 2
  t=5  j=2 m(2)=[0, 4) # secs in m(2): 4
=== t = 6
  t=6  j=0 m(0)=[5, 6) # secs in m(0): 1
  t=6  j=1 m(1)=[4, 6) # secs in m(1): 2
  t=6  j=2 m(2)=[0, 4) # secs in m(2): 4
=== t = 7
  t=7  j=0 m(0)=[6, 7) # secs in m(0): 1
  t=7  j=1 m(1)=[4, 6) # secs in m(1): 2
  t=7  j=2 m(2)=[0, 4) # secs in m(2): 4
=== t = 8
  t=8  j=0 m(0)=[7, 8) # secs in m(0): 1
  t=8  j=1 m(1)=[6, 8) # secs in m(1): 2
  t=8  j=2 m(2)=[4, 8) # secs in m(2): 4
  t=8  j=3 m(3)=[0, 8) # secs in m(3): 8
=== t = 9
  t=9  j=0 m(0)=[8, 9) # secs in m(0): 1
  t=9  j=1 m(1)=[6, 8) # secs in m(1): 2
  t=9  j=2 m(2)=[4, 8) # secs in m(2): 4
  t=9  j=3 m(3)=[0, 8) # secs in m(3): 8

numIntervals The number of sketches to keep in the exponential backoff. the last one will have a sketch of all data. Default value is 16.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TimeAggregation
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TimeAggregation(aggregates: MutableList[CountMinSketch[T]])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val aggregates: MutableList[CountMinSketch[T]]

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. def increment(cms: CountMinSketch[T], t: Long, rangeToAggregate: Int): Unit

    Permalink
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def query(index: Int, key: T): Option[Long]

    Permalink
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    TimeAggregation → AnyRef → Any
  20. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped