Class

com.twitter.algebird.mutable

PriorityQueueToListAggregator

Related Doc: package mutable

Permalink

class PriorityQueueToListAggregator[A] extends PriorityQueueAggregator[A, List[A]]

Should probably be your default Top-K implementation

Source
PriorityQueueAggregator.scala
Linear Supertypes
PriorityQueueAggregator[A, List[A]], MonoidAggregator[A, PriorityQueue[A], List[A]], Aggregator[A, PriorityQueue[A], List[A]], Serializable, AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PriorityQueueToListAggregator
  2. PriorityQueueAggregator
  3. MonoidAggregator
  4. Aggregator
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PriorityQueueToListAggregator(max: Int)(implicit ord: Ordering[A])

    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. def andThenPresent[D](present2: (List[A]) ⇒ D): MonoidAggregator[A, PriorityQueue[A], D]

    Permalink

    Like calling andThen on the present function

    Like calling andThen on the present function

    Definition Classes
    MonoidAggregatorAggregator
  5. def append(l: PriorityQueue[A], r: A): PriorityQueue[A]

    Permalink
    Definition Classes
    Aggregator
  6. def appendAll(items: TraversableOnce[A]): PriorityQueue[A]

    Permalink
    Definition Classes
    MonoidAggregator
  7. def appendAll(old: PriorityQueue[A], items: TraversableOnce[A]): PriorityQueue[A]

    Permalink
    Definition Classes
    Aggregator
  8. def apply(inputs: TraversableOnce[A]): List[A]

    Permalink

    This may error if inputs are empty (for Monoid Aggregators it never will, instead you see present(Monoid.zero[B])

    This may error if inputs are empty (for Monoid Aggregators it never will, instead you see present(Monoid.zero[B])

    Definition Classes
    Aggregator
  9. def applyCumulatively[In <: TraversableOnce[A], Out](inputs: In)(implicit bf: CanBuildFrom[In, List[A], Out]): Out

    Permalink

    This returns the cumulative sum of its inputs, in the same order.

    This returns the cumulative sum of its inputs, in the same order. If the inputs are empty, the result will be empty too.

    Definition Classes
    Aggregator
  10. def applyOption(inputs: TraversableOnce[A]): Option[List[A]]

    Permalink

    This returns None if the inputs are empty

    This returns None if the inputs are empty

    Definition Classes
    Aggregator
  11. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def composePrepare[A2](prepare2: (A2) ⇒ A): MonoidAggregator[A2, PriorityQueue[A], List[A]]

    Permalink

    Like calling compose on the prepare function

    Like calling compose on the prepare function

    Definition Classes
    MonoidAggregatorAggregator
  14. def cumulativeIterator(inputs: Iterator[A]): Iterator[List[A]]

    Permalink

    This returns the cumulative sum of its inputs, in the same order.

    This returns the cumulative sum of its inputs, in the same order. If the inputs are empty, the result will be empty too.

    Definition Classes
    Aggregator
  15. def either[A2, B2, C2](that: MonoidAggregator[A2, B2, C2]): MonoidAggregator[Either[A, A2], (PriorityQueue[A], B2), (List[A], C2)]

    Permalink

    Build a MonoidAggregator that either takes left or right input and outputs the pair from both

    Build a MonoidAggregator that either takes left or right input and outputs the pair from both

    Definition Classes
    MonoidAggregator
  16. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. def filterBefore[A1 <: A](pred: (A1) ⇒ Boolean): MonoidAggregator[A1, PriorityQueue[A], List[A]]

    Permalink

    Only aggregate items that match a predicate

    Only aggregate items that match a predicate

    Definition Classes
    MonoidAggregator
  19. def finalize(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. def join[A2 <: A, B2, C2](that: Aggregator[A2, B2, C2]): Aggregator[A2, (PriorityQueue[A], B2), (List[A], C2)]

    Permalink

    This allows you to run two aggregators on the same data with a single pass

    This allows you to run two aggregators on the same data with a single pass

    Definition Classes
    Aggregator
  24. def lift: MonoidAggregator[A, Option[PriorityQueue[A]], Option[List[A]]]

    Permalink
    Definition Classes
    Aggregator
  25. val monoid: PriorityQueueMonoid[A]

    Permalink
  26. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  29. final def prepare(a: A): PriorityQueue[A]

    Permalink
    Definition Classes
    PriorityQueueAggregatorAggregator
  30. def present(q: PriorityQueue[A]): List[A]

    Permalink
  31. final def reduce(items: TraversableOnce[PriorityQueue[A]]): PriorityQueue[A]

    Permalink

    This may error if items is empty.

    This may error if items is empty. To be safe you might use reduceOption if you don't know that items is non-empty

    Definition Classes
    MonoidAggregatorAggregator
  32. def reduce(l: PriorityQueue[A], r: PriorityQueue[A]): PriorityQueue[A]

    Permalink

    combine two inner values

    combine two inner values

    Definition Classes
    Aggregator
  33. def reduceOption(items: TraversableOnce[PriorityQueue[A]]): Option[PriorityQueue[A]]

    Permalink

    This is the safe version of the above.

    This is the safe version of the above. If the input in empty, return None, else reduce the items

    Definition Classes
    Aggregator
  34. def semigroup: Monoid[PriorityQueue[A]]

    Permalink
    Definition Classes
    MonoidAggregatorAggregator
  35. def sumBefore: MonoidAggregator[TraversableOnce[A], PriorityQueue[A], List[A]]

    Permalink

    This maps the inputs to Bs, then sums them, effectively flattening the inputs to the MonoidAggregator

    This maps the inputs to Bs, then sums them, effectively flattening the inputs to the MonoidAggregator

    Definition Classes
    MonoidAggregator
  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  37. def toFold: Fold[A, Option[List[A]]]

    Permalink

    An Aggregator can be converted to a Fold, but not vice-versa Note, a Fold is more constrained so only do this if you require joining a Fold with an Aggregator to produce a Fold

    An Aggregator can be converted to a Fold, but not vice-versa Note, a Fold is more constrained so only do this if you require joining a Fold with an Aggregator to produce a Fold

    Definition Classes
    Aggregator
  38. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. def zip[A2, B2, C2](ag2: MonoidAggregator[A2, B2, C2]): MonoidAggregator[(A, A2), (PriorityQueue[A], B2), (List[A], C2)]

    Permalink

    This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.

    This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.

    The law here is: ag1.zip(ag2).apply(as.zip(bs)) == (ag1(as), ag2(bs))

    Definition Classes
    MonoidAggregator
  43. def zip[A2, B2, C2](ag2: Aggregator[A2, B2, C2]): Aggregator[(A, A2), (PriorityQueue[A], B2), (List[A], C2)]

    Permalink

    This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.

    This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.

    The law here is: ag1.zip(ag2).apply(as.zip(bs)) == (ag1(as), ag2(bs))

    Definition Classes
    Aggregator

Inherited from PriorityQueueAggregator[A, List[A]]

Inherited from MonoidAggregator[A, PriorityQueue[A], List[A]]

Inherited from Aggregator[A, PriorityQueue[A], List[A]]

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped