T
- Tuple type of input streamsU
- Tuple type of output streampublic class FanIn<T,U> extends AbstractOplet<T,U>
For each tuple received, receiver.apply(T tuple, Integer index)
is called. index
is the tuple's input stream's index, where
this
is index 0 followed by others
in their order.
receiver
either returns a tuple to emit on the output
stream or null.
Constructor and Description |
---|
FanIn() |
FanIn(BiFunction<T,java.lang.Integer,U> receiver) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected Consumer<T> |
consumer(int iportIndex)
Create a Consumer for the input port that invokes the
receiver and submits a generated tuple, if any, to the output.
|
protected Consumer<U> |
getDestination() |
java.util.List<? extends Consumer<T>> |
getInputs()
Get the input stream data handlers for this oplet.
|
void |
initialize(OpletContext<T,U> context)
Initialize the oplet.
|
protected void |
setReceiver(BiFunction<T,java.lang.Integer,U> receiver)
Set the receiver function.
|
void |
start()
Start the oplet.
|
protected void |
submit(U tuple)
Submit a tuple to single output.
|
getOpletContext
public FanIn()
public FanIn(BiFunction<T,java.lang.Integer,U> receiver)
public void initialize(OpletContext<T,U> context)
Oplet
initialize
in interface Oplet<T,U>
initialize
in class AbstractOplet<T,U>
context
- the OpletContextprotected void setReceiver(BiFunction<T,java.lang.Integer,U> receiver)
initialize(OpletContext)
.receiver
- function to receive tuplespublic void start()
Oplet
public java.util.List<? extends Consumer<T>> getInputs()
Oplet
protected Consumer<T> consumer(int iportIndex)
iportIndex
- index of the input portprotected void submit(U tuple)
tuple
- Tuple to be submitted.public void close()
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641