Class

com.twitter.summingbird

OptionMappedProducer

Related Doc: package summingbird

Permalink

case class OptionMappedProducer[P <: Platform[P], T, +U](producer: Producer[P, T], fn: (T) ⇒ Option[U]) extends Producer[P, U] with Product with Serializable

Represents filters and maps which may be optimized differently Note that "option-mapping" is closed under composition and hence useful to call out

Linear Supertypes
Serializable, Serializable, Product, Equals, Producer[P, U], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. OptionMappedProducer
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Producer
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OptionMappedProducer(producer: Producer[P, T], fn: (T) ⇒ Option[U])

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++[U >: U](r: Producer[P, U]): Producer[P, U]

    Permalink

    Exactly the same as merge.

    Exactly the same as merge. Here by analogy with the scala.collections API

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

    Permalink
    Definition Classes
    AnyRef → Any
  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. def collect[U](fn: PartialFunction[U, U]): Producer[P, U]

    Permalink

    Prefer to flatMap for transforming a subset of items like optionMap but convenient with case syntax in scala prod.collect { case x if fn(x) => g(x) }

    Prefer to flatMap for transforming a subset of items like optionMap but convenient with case syntax in scala prod.collect { case x if fn(x) => g(x) }

    Definition Classes
    Producer
  8. def either[U](other: Producer[P, U]): Producer[P, Either[U, U]]

    Permalink

    Merge a different type of Producer into a single stream

    Merge a different type of Producer into a single stream

    Definition Classes
    Producer
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def filter(fn: (U) ⇒ Boolean): Producer[P, U]

    Permalink

    Keep only the items that satisfy the fn

    Keep only the items that satisfy the fn

    Definition Classes
    Producer
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def flatMap[U](fn: (U) ⇒ TraversableOnce[U]): Producer[P, U]

    Permalink

    Only use this function if you may return more than 1 item sometimes.

    Only use this function if you may return more than 1 item sometimes. otherwise use collect or optionMap, which can be pushed up the graph

    Definition Classes
    Producer
  13. val fn: (T) ⇒ Option[U]

    Permalink
  14. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    Any
  16. def lookup[U >: U, V](service: P.Service[U, V]): KeyedProducer[P, U, Option[V]]

    Permalink

    This is identical to a certain leftJoin: map((_, ())).leftJoin(srv).mapValues{case (_, v) => v} Useful when you are looking up values from say a stream of inputs, such as IDs.

    This is identical to a certain leftJoin: map((_, ())).leftJoin(srv).mapValues{case (_, v) => v} Useful when you are looking up values from say a stream of inputs, such as IDs.

    Definition Classes
    Producer
  17. def map[U](fn: (U) ⇒ U): Producer[P, U]

    Permalink

    Map each item to a new value

    Map each item to a new value

    Definition Classes
    Producer
  18. def merge[U >: U](r: Producer[P, U]): Producer[P, U]

    Permalink

    Combine the output into one Producer

    Combine the output into one Producer

    Definition Classes
    Producer
  19. def name(id: String): Producer[P, U]

    Permalink

    Naming a node is so that you may give Options for that node that may change the run-time performance of the job (parameter tuning, etc...)

    Naming a node is so that you may give Options for that node that may change the run-time performance of the job (parameter tuning, etc...)

    Definition Classes
    Producer
  20. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  23. def optionMap[U](fn: (U) ⇒ Option[U]): Producer[P, U]

    Permalink

    Prefer this or collect to flatMap if you are always emitting 0 or 1 items

    Prefer this or collect to flatMap if you are always emitting 0 or 1 items

    Definition Classes
    Producer
  24. val producer: Producer[P, T]

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

    Permalink
    Definition Classes
    AnyRef
  26. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. def write[U >: U](sink: P.Sink[U]): TailProducer[P, U]

    Permalink

    Cause some side effect on the sink, but pass through the values so they can be consumed downstream

    Cause some side effect on the sink, but pass through the values so they can be consumed downstream

    Definition Classes
    Producer

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Producer[P, U]

Inherited from AnyRef

Inherited from Any

Ungrouped