com.twitter.scalding.typed

IdentityValueSortedReduce

case class IdentityValueSortedReduce[K, V1](keyOrdering: Ordering[K], mapped: TypedPipe[(K, V1)], valueSort: Ordering[_ >: V1], reducers: Option[Int], descriptions: Seq[String]) extends ReduceStep[K, V1] with SortedGrouped[K, V1] with Reversable[IdentityValueSortedReduce[K, V1]] with Product with Serializable

Linear Supertypes
Serializable, Product, Equals, Reversable[IdentityValueSortedReduce[K, V1]], SortedGrouped[K, V1], WithDescription[SortedGrouped[K, V1]], HasDescription, WithReducers[SortedGrouped[K, V1]], HasReducers, KeyedListLike[K, V1, SortedGrouped], Serializable, ReduceStep[K, V1], KeyedPipe[K], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. IdentityValueSortedReduce
  2. Serializable
  3. Product
  4. Equals
  5. Reversable
  6. SortedGrouped
  7. WithDescription
  8. HasDescription
  9. WithReducers
  10. HasReducers
  11. KeyedListLike
  12. Serializable
  13. ReduceStep
  14. KeyedPipe
  15. AnyRef
  16. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new IdentityValueSortedReduce(keyOrdering: Ordering[K], mapped: TypedPipe[(K, V1)], valueSort: Ordering[_ >: V1], reducers: Option[Int], descriptions: Seq[String])

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def aggregate[B, C](agg: Aggregator[V1, B, C]): SortedGrouped[K, C]

    Use Algebird Aggregator to do the reduction

    Use Algebird Aggregator to do the reduction

    Definition Classes
    KeyedListLike
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def bufferedTake(n: Int): SortedGrouped[K, V1]

    This does the partial heap sort followed by take in memory on the mappers before sending to the reducers.

    This does the partial heap sort followed by take in memory on the mappers before sending to the reducers. This is a big help if there are relatively few keys and n is relatively small.

    Definition Classes
    IdentityValueSortedReduceKeyedListLike
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def count(fn: (V1) ⇒ Boolean): SortedGrouped[K, Long]

    For each key, count the number of values that satisfy a predicate

    For each key, count the number of values that satisfy a predicate

    Definition Classes
    KeyedListLike
  11. val descriptions: Seq[String]

  12. def distinctSize: SortedGrouped[K, Long]

    For each key, give the number of unique values.

    For each key, give the number of unique values. WARNING: May OOM. This assumes the values for each key can fit in memory.

    Definition Classes
    KeyedListLike
  13. def distinctValues: SortedGrouped[K, V1]

    For each key, remove duplicate values.

    For each key, remove duplicate values. WARNING: May OOM. This assumes the values for each key can fit in memory.

    Definition Classes
    KeyedListLike
  14. def drop(n: Int): SortedGrouped[K, V1]

    For each key, selects all elements except first n ones.

    For each key, selects all elements except first n ones.

    Definition Classes
    KeyedListLike
  15. def dropWhile(p: (V1) ⇒ Boolean): SortedGrouped[K, V1]

    For each key, Drops longest prefix of elements that satisfy the given predicate.

    For each key, Drops longest prefix of elements that satisfy the given predicate.

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

    Definition Classes
    AnyRef
  17. def filter(fn: ((K, V1)) ⇒ Boolean): SortedGrouped[K, V1]

    .

    .filter(fn).toTypedPipe == .toTypedPipe.filter(fn) It is generally better to avoid going back to a TypedPipe as long as possible: this minimizes the times we go in and out of cascading/hadoop types.

    Definition Classes
    KeyedListLike
  18. def filterKeys(fn: (K) ⇒ Boolean): IdentityValueSortedReduce[K, V1]

    filter keys on a predicate.

    filter keys on a predicate. More efficient than filter if you are only looking at keys

    Definition Classes
    IdentityValueSortedReduceKeyedListLike
  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def flatMapValues[V](fn: (V1) ⇒ TraversableOnce[V]): SortedGrouped[K, V]

    Similar to mapValues, but works like flatMap, returning a collection of outputs for each value input.

    Similar to mapValues, but works like flatMap, returning a collection of outputs for each value input.

    Definition Classes
    KeyedListLike
  21. def flattenValues[U](implicit ev: <:<[V1, TraversableOnce[U]]): SortedGrouped[K, U]

    flatten the values Useful after sortedTake, for instance

    flatten the values Useful after sortedTake, for instance

    Definition Classes
    KeyedListLike
  22. def fold[V](f: Fold[V1, V]): SortedGrouped[K, V]

    Folds are composable aggregations that make one pass over the data.

    Folds are composable aggregations that make one pass over the data. If you need to do several custom folds over the same data, use Fold.join and this method

    Definition Classes
    KeyedListLike
  23. def foldLeft[B](z: B)(fn: (B, V1) ⇒ B): SortedGrouped[K, B]

    For each key, fold the values.

    For each key, fold the values. see scala.collection.Iterable.foldLeft

    Definition Classes
    KeyedListLike
  24. def foldWithKey[V](fn: (K) ⇒ Fold[V1, V]): SortedGrouped[K, V]

    If the fold depends on the key, use this method to construct the fold for each key

    If the fold depends on the key, use this method to construct the fold for each key

    Definition Classes
    KeyedListLike
  25. def forall(fn: (V1) ⇒ Boolean): SortedGrouped[K, Boolean]

    For each key, check to see if a predicate is true for all Values

    For each key, check to see if a predicate is true for all Values

    Definition Classes
    KeyedListLike
  26. def forceToReducers: SortedGrouped[K, V1]

    This is just short hand for mapValueStream(identity), it makes sure the planner sees that you want to force a shuffle.

    This is just short hand for mapValueStream(identity), it makes sure the planner sees that you want to force a shuffle. For expert tuning

    Definition Classes
    KeyedListLike
  27. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  28. def groupOp[V2](gb: (GroupBuilder) ⇒ GroupBuilder): TypedPipe[(K, V2)]

    Attributes
    protected
    Definition Classes
    ReduceStep
  29. def groupOpWithValueSort[V2](valueSort: Option[Ordering[_ >: V1]])(gb: (GroupBuilder) ⇒ GroupBuilder): TypedPipe[(K, V2)]

    Attributes
    protected
    Definition Classes
    ReduceStep
  30. def head: SortedGrouped[K, V1]

    Use this to get the first value encountered.

    Use this to get the first value encountered. prefer this to take(1).

    Definition Classes
    KeyedListLike
  31. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  32. val keyOrdering: Ordering[K]

    Definition Classes
    IdentityValueSortedReduceKeyedPipe
  33. def keys: TypedPipe[K]

    Convert to a TypedPipe and only keep the keys

    Convert to a TypedPipe and only keep the keys

    Definition Classes
    KeyedListLike
  34. def mapGroup[V3](fn: (K, Iterator[V1]) ⇒ Iterator[V3]): ValueSortedReduce[K, V1, V3]

    Operate on an Iterator[T] of all the values for each key at one time.

    Operate on an Iterator[T] of all the values for each key at one time. Prefer this to toList, when you can avoid accumulating the whole list in memory. Prefer sum, which is partially executed map-side by default. Use mapValueStream when you don't care about the key for the group.

    Iterator is always Non-empty. Note, any key that has all values removed will not appear in subsequent .mapGroup/mapValueStream

    Definition Classes
    IdentityValueSortedReduceKeyedListLike
  35. def mapValueStream[V](smfn: (Iterator[V1]) ⇒ Iterator[V]): SortedGrouped[K, V]

    Use this when you don't care about the key for the group, otherwise use mapGroup

    Use this when you don't care about the key for the group, otherwise use mapGroup

    Definition Classes
    KeyedListLike
  36. def mapValues[V](fn: (V1) ⇒ V): SortedGrouped[K, V]

    This is a special case of mapValueStream, but can be optimized because it doesn't need all the values for a given key at once.

    This is a special case of mapValueStream, but can be optimized because it doesn't need all the values for a given key at once. An unoptimized implementation is: mapValueStream { _.map { fn } } but for Grouped we can avoid resorting to mapValueStream

    Definition Classes
    KeyedListLike
  37. val mapped: TypedPipe[(K, V1)]

    Note, this satisfies KeyedPipe.

    Note, this satisfies KeyedPipe.mapped: TypedPipe[(K, Any)]

    Definition Classes
    IdentityValueSortedReduceReduceStepKeyedPipe
  38. def max[B >: V1](implicit cmp: Ordering[B]): SortedGrouped[K, V1]

    For each key, give the maximum value

    For each key, give the maximum value

    Definition Classes
    KeyedListLike
  39. def maxBy[B](fn: (V1) ⇒ B)(implicit cmp: Ordering[B]): SortedGrouped[K, V1]

    For each key, give the maximum value by some function

    For each key, give the maximum value by some function

    Definition Classes
    KeyedListLike
  40. def min[B >: V1](implicit cmp: Ordering[B]): SortedGrouped[K, V1]

    For each key, give the minimum value

    For each key, give the minimum value

    Definition Classes
    KeyedListLike
  41. def minBy[B](fn: (V1) ⇒ B)(implicit cmp: Ordering[B]): SortedGrouped[K, V1]

    For each key, give the minimum value by some function

    For each key, give the minimum value by some function

    Definition Classes
    KeyedListLike
  42. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  43. final def notify(): Unit

    Definition Classes
    AnyRef
  44. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  45. def product[U >: V1](implicit ring: Ring[U]): SortedGrouped[K, U]

    For each key, Return the product of all the values

    For each key, Return the product of all the values

    Definition Classes
    KeyedListLike
  46. def reduce[U >: V1](fn: (U, U) ⇒ U): SortedGrouped[K, U]

    reduce with fn which must be associative and commutative.

    reduce with fn which must be associative and commutative. Like the above this can be optimized in some Grouped cases. If you don't have a commutative operator, use reduceLeft

    Definition Classes
    KeyedListLike
  47. def reduceLeft[U >: V1](fn: (U, U) ⇒ U): SortedGrouped[K, U]

    Similar to reduce but always on the reduce-side (never optimized to mapside), and named for the scala function.

    Similar to reduce but always on the reduce-side (never optimized to mapside), and named for the scala function. fn need not be associative and/or commutative. Makes sense when you want to reduce, but in a particular sorted order. the old value comes in on the left.

    Definition Classes
    KeyedListLike
  48. val reducers: Option[Int]

    Definition Classes
    IdentityValueSortedReduceHasReducers
  49. def reverse: IdentityValueSortedReduce[K, V1]

    Definition Classes
    IdentityValueSortedReduceReversable
  50. def scanLeft[B](z: B)(fn: (B, V1) ⇒ B): SortedGrouped[K, B]

    For each key, scanLeft the values.

    For each key, scanLeft the values. see scala.collection.Iterable.scanLeft

    Definition Classes
    KeyedListLike
  51. def size: SortedGrouped[K, Long]

    For each key, give the number of values

    For each key, give the number of values

    Definition Classes
    KeyedListLike
  52. def sortWithTake[U >: V1](k: Int)(lessThan: (U, U) ⇒ Boolean): SortedGrouped[K, Seq[V1]]

    Like the above, but with a less than operation for the ordering

    Like the above, but with a less than operation for the ordering

    Definition Classes
    KeyedListLike
  53. def sortedReverseTake(k: Int)(implicit ord: Ordering[_ >: V1]): SortedGrouped[K, Seq[V1]]

    Take the largest k things according to the implicit ordering.

    Take the largest k things according to the implicit ordering. Useful for top-k without having to call ord.reverse

    Definition Classes
    KeyedListLike
  54. def sortedTake(k: Int)(implicit ord: Ordering[_ >: V1]): SortedGrouped[K, Seq[V1]]

    This implements bottom-k (smallest k items) on each mapper for each key, then sends those to reducers to get the result.

    This implements bottom-k (smallest k items) on each mapper for each key, then sends those to reducers to get the result. This is faster than using .take if k * (number of Keys) is small enough to fit in memory.

    Definition Classes
    KeyedListLike
  55. def sum[U >: V1](implicit sg: Semigroup[U]): SortedGrouped[K, U]

    Add all items according to the implicit Semigroup If there is no sorting, we default to assuming the Semigroup is commutative.

    Add all items according to the implicit Semigroup If there is no sorting, we default to assuming the Semigroup is commutative. If you don't want that, define an ordering on the Values, sort or .forceToReducers.

    Semigroups MAY have a faster implementation of sum for iterators, so prefer using sum/sumLeft to reduce

    Definition Classes
    KeyedListLike
  56. def sumLeft[U >: V1](implicit sg: Semigroup[U]): SortedGrouped[K, U]

    Semigroups MAY have a faster implementation of sum for iterators, so prefer using sum/sumLeft to reduce/reduceLeft

    Semigroups MAY have a faster implementation of sum for iterators, so prefer using sum/sumLeft to reduce/reduceLeft

    Definition Classes
    KeyedListLike
  57. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  58. def take(n: Int): SortedGrouped[K, V1]

    We are sorting then taking.

    We are sorting then taking. Optimized for small take values If we take <= 1, we use an in-memory-based method. To force a memory-based take, use bufferedTake Otherwise, we send all the values to the reducers

    Definition Classes
    IdentityValueSortedReduceKeyedListLike
  59. def takeWhile(p: (V1) ⇒ Boolean): SortedGrouped[K, V1]

    For each key, Takes longest prefix of elements that satisfy the given predicate.

    For each key, Takes longest prefix of elements that satisfy the given predicate.

    Definition Classes
    KeyedListLike
  60. def toList: SortedGrouped[K, List[V1]]

    AVOID THIS IF POSSIBLE For each key, accumulate all the values into a List.

    AVOID THIS IF POSSIBLE For each key, accumulate all the values into a List. WARNING: May OOM Only use this method if you are sure all the values will fit in memory. You really should try to ask why you need all the values, and if you want to do some custom reduction, do it in mapGroup or mapValueStream

    Definition Classes
    KeyedListLike
  61. def toSet[U >: V1]: SortedGrouped[K, Set[U]]

    AVOID THIS IF POSSIBLE Same risks apply here as to toList: you may OOM.

    AVOID THIS IF POSSIBLE Same risks apply here as to toList: you may OOM. See toList. Note that toSet needs to be parameterized even though toList does not. This is because List is covariant in its type parameter in the scala API, but Set is invariant. See: http://stackoverflow.com/questions/676615/why-is-scalas-immutable-set-not-covariant-in-its-type

    Definition Classes
    KeyedListLike
  62. lazy val toTypedPipe: TypedPipe[(K, V1)]

  63. val valueSort: Ordering[_ >: V1]

  64. def values: TypedPipe[V1]

    Convert to a TypedPipe and only keep the values

    Convert to a TypedPipe and only keep the values

    Definition Classes
    KeyedListLike
  65. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. def withDescription(description: String): IdentityValueSortedReduce[K, V1]

    never mutates this, instead returns a new item.

    never mutates this, instead returns a new item.

    Definition Classes
    IdentityValueSortedReduceWithDescription
  69. def withDescription(descriptionOpt: Option[String]): SortedGrouped[K, V1]

    Definition Classes
    WithDescription
  70. def withReducers(red: Int): IdentityValueSortedReduce[K, V1]

    never mutates this, instead returns a new item.

    never mutates this, instead returns a new item.

    Definition Classes
    IdentityValueSortedReduceWithReducers

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Reversable[IdentityValueSortedReduce[K, V1]]

Inherited from SortedGrouped[K, V1]

Inherited from WithDescription[SortedGrouped[K, V1]]

Inherited from HasDescription

Inherited from WithReducers[SortedGrouped[K, V1]]

Inherited from HasReducers

Inherited from KeyedListLike[K, V1, SortedGrouped]

Inherited from Serializable

Inherited from ReduceStep[K, V1]

Inherited from KeyedPipe[K]

Inherited from AnyRef

Inherited from Any

Ungrouped