public final class Partition<T> extends GraphStage<UniformFanOutShape<T,T>>
'''Emits when''' emits when an element is available from the input and the chosen output has demand
'''Backpressures when''' the currently chosen output back-pressures
'''Completes when''' upstream completes and no output is pending
'''Cancels when''' when all downstreams cancel
Modifier and Type | Class and Description |
---|---|
static class |
Partition.PartitionOutOfBoundsException |
static class |
Partition.PartitionOutOfBoundsException$ |
Constructor and Description |
---|
Partition(int outputPorts,
scala.Function1<T,java.lang.Object> partitioner) |
Modifier and Type | Method and Description |
---|---|
static Graph<S,M> |
addAttributes(Attributes attr) |
static <T> Partition<T> |
apply(int outputPorts,
scala.Function1<T,java.lang.Object> partitioner)
Create a new
Partition stage with the specified input type. |
static Graph<S,M> |
async() |
GraphStageLogic |
createLogic(Attributes inheritedAttributes) |
static scala.Tuple2<GraphStageLogic,NotUsed> |
createLogicAndMaterializedValue(Attributes inheritedAttributes) |
Inlet<T> |
in() |
protected static Attributes |
initialAttributes() |
static StreamLayout.Module |
module() |
static Graph<S,M> |
named(java.lang.String name) |
scala.collection.Seq<Outlet<T>> |
out() |
int |
outputPorts() |
scala.Function1<T,java.lang.Object> |
partitioner() |
UniformFanOutShape<T,T> |
shape()
The shape of a graph is all that is externally visible: its inlets and outlets.
|
java.lang.String |
toString() |
static Graph<S,M> |
withAttributes(Attributes attr) |
createLogicAndMaterializedValue
initialAttributes, module, withAttributes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAttributes, async, named
public Partition(int outputPorts, scala.Function1<T,java.lang.Object> partitioner)
public static <T> Partition<T> apply(int outputPorts, scala.Function1<T,java.lang.Object> partitioner)
Partition
stage with the specified input type.
outputPorts
- number of output portspartitioner
- function deciding which output each element will be targetedpublic static Graph<S,M> named(java.lang.String name)
public static Graph<S,M> async()
public static Graph<S,M> addAttributes(Attributes attr)
protected static Attributes initialAttributes()
public static final StreamLayout.Module module()
public static final Graph<S,M> withAttributes(Attributes attr)
public static final scala.Tuple2<GraphStageLogic,NotUsed> createLogicAndMaterializedValue(Attributes inheritedAttributes)
public int outputPorts()
public scala.Function1<T,java.lang.Object> partitioner()
public UniformFanOutShape<T,T> shape()
Graph
public GraphStageLogic createLogic(Attributes inheritedAttributes)
createLogic
in class GraphStage<UniformFanOutShape<T,T>>
public java.lang.String toString()
toString
in class java.lang.Object