com.twitter.summingbird.online.executor

Summer

class Summer[Key, Value, Event, S, D, RC] extends AsyncBase[(Int, Map[Key, Value]), Event, InputState[S], D, RC]

The SummerBolt takes two related options: CacheSize and MaxWaitingFutures. CacheSize sets the number of key-value pairs that the SinkBolt will accept (and sum into an internal map) before committing out to the online store.

To perform this commit, the SinkBolt iterates through the map of aggregated kv pairs and performs a "+" on the store for each pair, sequencing these "+" calls together using the Future monad. If the store has high latency, these calls might take a bit of time to complete.

MaxWaitingFutures(count) handles this problem by realizing a future representing the "+" of kv-pair n only when kvpair n + 100 shows up in the bolt, effectively pushing back against latency bumps in the host.

The allowed latency before a future is forced is equal to (MaxWaitingFutures * execute latency).

Source
Summer.scala
Linear Supertypes
AsyncBase[(Int, Map[Key, Value]), Event, InputState[S], D, RC], OperationContainer[(Int, Map[Key, Value]), Event, InputState[S], D, RC], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Summer
  2. AsyncBase
  3. OperationContainer
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Summer(storeSupplier: MergeableStoreFactory[Key, Value], flatMapOp: FlatMapOperation[(Key, (Option[Value], Value)), Event], successHandler: OnlineSuccessHandler, exceptionHandler: OnlineExceptionHandler, summerBuilder: SummerBuilder, maxWaitingFutures: MaxWaitingFutures, maxWaitingTime: MaxFutureWaitTime, maxEmitPerExec: MaxEmitPerExecute, includeSuccessHandler: IncludeSuccessHandler, pDecoder: Injection[(Int, Map[Key, Value]), D], pEncoder: Injection[Event, D])(implicit arg0: Semigroup[Value])

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 apply(state: InputState[S], tupList: (Int, Map[Key, Value])): Future[TraversableOnce[(Seq[InputState[S]], Future[TraversableOnce[Event]])]]

    If you can use Future.

    If you can use Future.value below, do so. The double Future is here to deal with cases that need to complete operations after or before doing a FlatMapOperation or doing a store merge

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

    Definition Classes
    Any
  8. def cleanup: Unit

    Definition Classes
    SummerOperationContainer
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val decoder: Injection[(Int, Map[Key, Value]), D]

    Definition Classes
    SummerOperationContainer
  11. val encoder: Injection[Event, D]

    Definition Classes
    SummerOperationContainer
  12. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  14. val exceptionHandlerBox: Externalizer[(Throwable) ⇒ Option[Unit]]

  15. def execute(state: InputState[S], data: (Int, Map[Key, Value])): Seq[(Seq[InputState[S]], Try[TraversableOnce[Event]])]

    Definition Classes
    AsyncBaseOperationContainer
  16. def executeTick: Seq[(Seq[InputState[S]], Try[TraversableOnce[Event]])]

    Definition Classes
    AsyncBaseOperationContainer
  17. def finalize(): Unit

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

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

    Definition Classes
    AnyRef → Any
  20. def init(runtimeContext: RC): Unit

    Definition Classes
    SummerOperationContainer
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. val lockedOp: Externalizer[FlatMapOperation[(Key, (Option[Value], Value)), Event]]

  23. lazy val logger: Logger

    Attributes
    protected
    Definition Classes
    AsyncBase
  24. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  27. def notifyFailure(inputs: Seq[InputState[S]], error: Throwable): Unit

    Definition Classes
    SummerOperationContainer
  28. lazy val sSummer: AsyncSummer[(Key, (Seq[InputState[S]], Value)), Map[Key, (Seq[InputState[S]], Value)]]

  29. lazy val store: Mergeable[Key, Value]

  30. val storeBox: Externalizer[MergeableStoreFactory[Key, Value]]

  31. lazy val storePromise: Promise[Mergeable[Key, Value]]

  32. val successHandlerBox: Externalizer[OnlineSuccessHandler]

  33. var successHandlerOpt: Option[OnlineSuccessHandler]

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

    Definition Classes
    AnyRef
  35. def tick: Future[TraversableOnce[(Seq[InputState[S]], Future[TraversableOnce[Event]])]]

    Definition Classes
    SummerAsyncBase
  36. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AsyncBase[(Int, Map[Key, Value]), Event, InputState[S], D, RC]

Inherited from OperationContainer[(Int, Map[Key, Value]), Event, InputState[S], D, RC]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped