com.twitter.bijection

Pivot

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.

Linear Supertypes
Bijection[Iterable[K], Map[K1, Iterable[K2]]], Serializable, (Iterable[K]) ⇒ Map[K1, Iterable[K2]], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Pivot
  2. Bijection
  3. Serializable
  4. Function1
  5. AnyRef
  6. 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: 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 andThen[C](g: Injection[Map[K1, Iterable[K2]], C]): Injection[Iterable[K], C]

    Definition Classes
    Bijection
  7. 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
  8. def andThen[A](g: (Map[K1, Iterable[K2]]) ⇒ A): (Iterable[K]) ⇒ A

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  9. def andThenPivot[K3, K4](after: Bijection[(K1, K2), (K3, K4)]): Pivot[K, K3, K4]

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

    Definition Classes
    PivotBijection → Function1
  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def clone(): AnyRef

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

    Definition Classes
    Bijection
  14. 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
  15. def compose[A](g: (A) ⇒ Iterable[K]): (A) ⇒ Map[K1, Iterable[K2]]

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  16. def composePivot[T](before: Bijection[T, K]): Pivot[T, K1, K2]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  32. def toString(): String

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

  34. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. 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.

  38. 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 (Iterable[K]) ⇒ Map[K1, Iterable[K2]]

Inherited from AnyRef

Inherited from Any

Ungrouped