Object

com.twitter.scalding.typed

LookupJoin

Related Doc: package typed

Permalink

object LookupJoin extends Serializable

lookupJoin simulates the behavior of a realtime system attempting to leftJoin (K, V) pairs against some other value type (JoinedV) by performing realtime lookups on a key-value Store.

An example would join (K, V) pairs of (URL, Username) against a service of (URL, ImpressionCount). The result of this join would be a pipe of (ShortenedURL, (Username, Option[ImpressionCount])).

To simulate this behavior, lookupJoin accepts pipes of key-value pairs with an explicit time value T attached. T must have some sensible ordering. The semantics are, if one were to hit the right pipe's simulated realtime service at any time between T(tuple) T(tuple + 1), one would receive Some((K, JoinedV)(tuple)).

The entries in the left pipe's tuples have the following meaning:

T: The time at which the (K, W) lookup occurred. K: the join key. W: the current value for the join key.

The right pipe's entries have the following meaning:

T: The time at which the "service" was fed an update K: the join K. V: value of the key at time T

Before the time T in the right pipe's very first entry, the simulated "service" will return None. After this time T, the right side will return None only if the key is absent, else, the service will return Some(joinedV).

Source
LookupJoin.scala
Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LookupJoin
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 apply[T, K, V, JoinedV](left: TypedPipe[(T, (K, V))], right: TypedPipe[(T, (K, JoinedV))], reducers: Option[Int] = None)(implicit arg0: Ordering[T], arg1: Ordering[K]): TypedPipe[(T, (K, (V, Option[JoinedV])))]

    Permalink

    This is the "infinite history" join and always joins regardless of how much time is between the left and the right

  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. final def isInstanceOf[T0]: Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  16. def rightSumming[T, K, V, JoinedV](left: TypedPipe[(T, (K, V))], right: TypedPipe[(T, (K, JoinedV))], reducers: Option[Int] = None)(implicit arg0: Ordering[T], arg1: Ordering[K], arg2: Semigroup[JoinedV]): TypedPipe[(T, (K, (V, Option[JoinedV])))]

    Permalink

    In this case, the right pipe is fed through a scanLeft doing a Semigroup.plus before joined to the left

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. def withWindow[T, K, V, JoinedV](left: TypedPipe[(T, (K, V))], right: TypedPipe[(T, (K, JoinedV))], reducers: Option[Int] = None)(gate: (T, T) ⇒ Boolean)(implicit arg0: Ordering[T], arg1: Ordering[K]): TypedPipe[(T, (K, (V, Option[JoinedV])))]

    Permalink

    This ensures that gate(Tleft, Tright) == true, else the None is emitted as the joined value.

    This ensures that gate(Tleft, Tright) == true, else the None is emitted as the joined value. Useful for bounding the time of the join to a recent window

  23. def withWindowRightSumming[T, K, V, JoinedV](left: TypedPipe[(T, (K, V))], right: TypedPipe[(T, (K, JoinedV))], reducers: Option[Int] = None)(gate: (T, T) ⇒ Boolean)(implicit arg0: Ordering[T], arg1: Ordering[K], arg2: Semigroup[JoinedV]): TypedPipe[(T, (K, (V, Option[JoinedV])))]

    Permalink

    This ensures that gate(Tleft, Tright) == true, else the None is emitted as the joined value, and sums are only done as long as they they come within the gate interval as well

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped