T
- Type of the tuple.public class Barrier<T> extends FanIn<T,java.util.List<T>>
Barrier
has n input ports with tuple type T
and one output port with tuple type List<T>
.
Once the oplet receives one tuple on each of its input ports,
it generates an output tuple containing one tuple from each input port.
It then awaits receiving the next collection of tuples.
Input port 0's tuple is in list[0], port 1's tuple in list[1], and so on.
Each input port has an associated queue of size queueCapacity
.
The input port's Consumer<T>.accept()
will block if it's queue is full.
Constructor and Description |
---|
Barrier(int queueCapacity)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
accept(T tuple,
int iportIndex) |
void |
close() |
void |
initialize(OpletContext<T,java.util.List<T>> context)
Initialize the oplet.
|
protected BiFunction<T,java.lang.Integer,java.util.List<T>> |
receiver() |
void |
start()
Start the oplet.
|
consumer, getDestination, getInputs, setReceiver, submit
getOpletContext
public Barrier(int queueCapacity)
queueCapacity
- size of each input port's blocking queuepublic void initialize(OpletContext<T,java.util.List<T>> context)
Oplet
initialize
in interface Oplet<T,java.util.List<T>>
initialize
in class FanIn<T,java.util.List<T>>
context
- the OpletContextpublic void start()
Oplet
protected BiFunction<T,java.lang.Integer,java.util.List<T>> receiver()
protected void accept(T tuple, int iportIndex)
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641