Class/Object

org.squbs.streams

BoundedOrdering

Related Docs: object BoundedOrdering | package streams

Permalink

class BoundedOrdering[A, B] extends GraphStage[FlowShape[A, A]]

Orders the stream within a sliding window of maxBounded elements. Each element passing through the BoundedOrdering has an id. The elements can be ordered by the ordering function and the next expected id can be derived from the current id.

It takes an element and emits downstream if the getId(elem) matches the currently stored id, if not enqueues to a priority queue. When an element is emitted, the stored id is updated by calling nextId to match the next expected element and an element is dequeued from the priority queue and emitted if it matches the updated id. If the out-of-order element arrives at a later point than maxBounded then it is emitted straight downstream.

A

The input and output type of this stream component.

B

The type of the element's id. Emits when getId(elem) matches the current state, if not enqueues it to priority queue Backpressures when downstream backpressures Completes when upstream completes Cancels when downstream cancels

Linear Supertypes
GraphStage[FlowShape[A, A]], GraphStageWithMaterializedValue[FlowShape[A, A], NotUsed], Graph[FlowShape[A, A], NotUsed], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BoundedOrdering
  2. GraphStage
  3. GraphStageWithMaterializedValue
  4. Graph
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BoundedOrdering(maxBounded: Int, initialId: B, nextId: (B) ⇒ B, getId: (A) ⇒ B)(implicit ordering: Ordering[B])

    Permalink

    maxBounded

    The number of elements to wait for an out-of-order element.

    initialId

    The id of the first element getting to the BoundedOrdering.

    nextId

    Function to calculate the subsequent id from the current id.

    getId

    Function to get the id from an element.

    ordering

    Defines how the element ids are being ordered.

Type Members

  1. type Shape = FlowShape[A, A]

    Permalink
    Definition Classes
    Graph

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 addAttributes(attr: Attributes): Graph[FlowShape[A, A], NotUsed]

    Permalink
    Definition Classes
    Graph
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def async(dispatcher: String, inputBufferSize: Int): Graph[FlowShape[A, A], NotUsed]

    Permalink
    Definition Classes
    Graph
  7. def async(dispatcher: String): Graph[FlowShape[A, A], NotUsed]

    Permalink
    Definition Classes
    Graph
  8. def async: Graph[FlowShape[A, A], NotUsed]

    Permalink
    Definition Classes
    Graph
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def createLogic(inheritedAttributes: Attributes): GraphStageLogic

    Permalink
    Definition Classes
    BoundedOrdering → GraphStage
  11. final def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, NotUsed)

    Permalink
    Definition Classes
    GraphStage → GraphStageWithMaterializedValue
  12. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. val in: Inlet[A]

    Permalink
  18. def initialAttributes: Attributes

    Permalink
    Attributes
    protected
    Definition Classes
    GraphStageWithMaterializedValue
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def named(name: String): Graph[FlowShape[A, A], NotUsed]

    Permalink
    Definition Classes
    Graph
  21. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  24. implicit val ordering: Ordering[B]

    Permalink

    Defines how the element ids are being ordered.

  25. val out: Outlet[A]

    Permalink
  26. val shape: FlowShape[A, A]

    Permalink
    Definition Classes
    BoundedOrdering → Graph
  27. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def withAttributes(attr: Attributes): Graph[FlowShape[A, A], NotUsed]

    Permalink
    Definition Classes
    GraphStageWithMaterializedValue → Graph

Inherited from GraphStage[FlowShape[A, A]]

Inherited from GraphStageWithMaterializedValue[FlowShape[A, A], NotUsed]

Inherited from Graph[FlowShape[A, A], NotUsed]

Inherited from AnyRef

Inherited from Any

Ungrouped