com.twitter.bijection

Pivot

Related Docs: object Pivot | package bijection

trait Pivot[K, K1, K2] extends Bijection[Iterable[K], Map[K1, Iterable[K2]]]

Pivot is useful in moving from a 1D space of K to a 2D mapping space of K1 x K2. If the elements within the K space have many repeated elements -- imagine the "time" component of a Key in a timeseries key-value store -- pivoting the changing component into an inner K2 while leaving the repeated component in an outer K1 can assist in compressing a datastore's space requirements.

Type Parameters:

K: Original Key K1: Outer Key K2: Inner Key

Trivial: Pivot[(Event, Timestamp), Event, Timestamp] would pivot the timestamp component out of a compound key.

Source
Pivot.scala
Linear Supertypes
Bijection[Iterable[K], Map[K1, Iterable[K2]]], Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Pivot
  2. Bijection
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def pivot: Bijection[K, (K1, K2)]

Concrete Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def andThen[C](g: (Map[K1, Iterable[K2]]) ⇒ C): (Iterable[K]) ⇒ C

    Definition Classes
    Bijection
  5. def andThen[C](g: Injection[Map[K1, Iterable[K2]], C]): Injection[Iterable[K], C]

    Definition Classes
    Bijection
  6. def andThen[C](g: Bijection[Map[K1, Iterable[K2]], C]): Bijection[Iterable[K], C]

    Composes two instances of Bijection in a new Bijection, with this one applied first.

    Composes two instances of Bijection in a new Bijection, with this one applied first.

    Definition Classes
    Bijection
  7. def andThenPivot[K3, K4](after: Bijection[(K1, K2), (K3, K4)]): Pivot[K, K3, K4]

  8. def apply(pairs: Iterable[K]): Map[K1, Iterable[K2]]

    Definition Classes
    PivotBijection
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def compose[T](g: (T) ⇒ Iterable[K]): (T) ⇒ Map[K1, Iterable[K2]]

    Definition Classes
    Bijection
  12. def compose[T](g: Injection[T, Iterable[K]]): Injection[T, Map[K1, Iterable[K2]]]

    Definition Classes
    Bijection
  13. def compose[T](g: Bijection[T, Iterable[K]]): Bijection[T, Map[K1, Iterable[K2]]]

    Composes two instances of Bijection in a new Bijection, with this one applied last.

    Composes two instances of Bijection in a new Bijection, with this one applied last.

    Definition Classes
    Bijection
  14. def composePivot[T](before: Bijection[T, K]): Pivot[T, K1, K2]

  15. lazy val decoder: PivotDecoder[K, K1, K2]

  16. lazy val encoder: PivotEncoder[K, K1, K2]

  17. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Definition Classes
    AnyRef → Any
  22. def inverse: Bijection[Map[K1, Iterable[K2]], Iterable[K]]

    Definition Classes
    Bijection
  23. def invert(m: Map[K1, Iterable[K2]]): Iterable[K]

    Definition Classes
    PivotBijection
  24. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    AnyRef
  28. def split[V](fn: (K) ⇒ V): (K1) ⇒ (K2) ⇒ V

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

    Definition Classes
    AnyRef
  30. def toFunction: (Iterable[K]) ⇒ Map[K1, Iterable[K2]]

    Definition Classes
    Bijection
  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. def unsplit[V](fn: (K1) ⇒ (K2) ⇒ V): (K) ⇒ V

  33. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def withValue[V]: Pivot[(K, V), K1, (K2, V)]

    Returns a new pivot that converts an Iterable of (K, V) to an Iterable of (K1, Iterable[(K2, V)]).

    Returns a new pivot that converts an Iterable of (K, V) to an Iterable of (K1, Iterable[(K2, V)]). This is useful for pivoting multiple (K, V) pairs into a single key in some KV store.

  37. def wrapOuter[T]: Pivot[(K, T), (K1, T), K2]

    Returns a new Pivot that converts an Iterable of (K, T) to an Iterable of ((K1, T), Iterable[K2]).

    Returns a new Pivot that converts an Iterable of (K, T) to an Iterable of ((K1, T), Iterable[K2]). This is useful for applying a new pivoting scheme on top of this one while maintaining some outer key component.

Inherited from Bijection[Iterable[K], Map[K1, Iterable[K2]]]

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped