Package bbflow
Class ff_pipeline<T,V>
java.lang.Object
bbflow.block<T,U>
bbflow.ff_node<T,V>
bbflow.ff_pipeline<T,V>
Pipeline building block allows auto-connection between all types of ff_blocks
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
(package private) pipeline_generic
static byte
one single channel between two blocks.static byte
N channels connecting first block to N elements in the second block.static byte
N channels connecting 1 to 1 elements of the two blocks.static byte
N channels connecting N elements in the first block to the second block.static byte
connect all N workers from left to all M workers from right. -
Constructor Summary
ConstructorsConstructorDescriptionconstructor of pipeline between two blocks of type 1-1 (one channel created between b1 and b2)constructor of pipeline between two blocks of type MULTI (see types)constructor of pipeline between two blocks of type 1-1 (one channel created between b1 and b2)constructor of pipeline between two blocks of type MULTI (see types) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInputChannel
(ff_queue<T> input) add a new input channel to the first block of the pipelinevoid
addOutputChannel
(ff_queue<V> output) add a new output channel to the last block of the pipelinevoid
appendBlock
(block<Object, Object> newblock) append a new block to pipeline connectedvoid
appendBlock
(block<Object, Object> newblock, byte MULTI) append a new block to pipeline connectedget first farm in the pipeline or null if notget last farm in the pipeline or null if notvoid
join()
wait end of all blocks in the pipelinestatic void
preload()
void
start()
start all blocks in the pipelineMethods inherited from class bbflow.ff_node
getInputChannel, getOutputChannel, removeInputChannel, removeOutputChannel
-
Field Details
-
pipe
pipeline_generic pipe -
bufferSize
int bufferSize -
TYPE_1_1
public static byte TYPE_1_1one single channel between two blocks. Using addInputChannel and addOutputChannel. If emitter or collector null in case of farm, 1_N or N_1 or N_N or NxM used. -
TYPE_1xN
public static byte TYPE_1xNN channels connecting first block to N elements in the second block. Used between collector of left farm to workers of second for example. If collector null, N_N or NxM used -
TYPE_Nx1
public static byte TYPE_Nx1N channels connecting N elements in the first block to the second block. Used for example between farm workers of first block to emitter of second. If emitter null, N_N or NxM used -
TYPE_N_N
public static byte TYPE_N_NN channels connecting 1 to 1 elements of the two blocks. Example N workers from left block and N workers of right block. The cardinality must be the same, otherwise NxM used. Emitter and colletor must be null, otherwise 1_N or N_1 is used. -
TYPE_NxM
public static byte TYPE_NxMconnect all N workers from left to all M workers from right.
-
-
Constructor Details
-
ff_pipeline
constructor of pipeline between two blocks of type 1-1 (one channel created between b1 and b2)- Parameters:
b1
- first blockb2
- second block
-
ff_pipeline
constructor of pipeline between two blocks of type 1-1 (one channel created between b1 and b2)- Parameters:
b1
- first blockb2
- second blockbufferSize
- buffer size of the channel
-
ff_pipeline
constructor of pipeline between two blocks of type MULTI (see types)- Parameters:
b1
- first blockb2
- second blockMULTI
- TYPE_1_1, TYPE_1_N, TYPE_Nx1, TYPE_N_N, TYPE_NxM
-
ff_pipeline
constructor of pipeline between two blocks of type MULTI (see types)- Parameters:
b1
- first blockb2
- second blockbufferSize
- buffer size of the channelsMULTI
- TYPE_1_1, TYPE_1_N, TYPE_Nx1, TYPE_N_N, TYPE_NxM
-
-
Method Details
-
preload
public static void preload() -
appendBlock
append a new block to pipeline connected- Parameters:
newblock
-MULTI
-
-
appendBlock
append a new block to pipeline connected- Parameters:
newblock
-
-
addInputChannel
add a new input channel to the first block of the pipeline- Overrides:
addInputChannel
in classff_node<T,
V> - Parameters:
input
- input channel
-
addOutputChannel
add a new output channel to the last block of the pipeline- Overrides:
addOutputChannel
in classff_node<T,
V> - Parameters:
output
- output channel
-
start
public void start()start all blocks in the pipeline -
join
public void join()wait end of all blocks in the pipeline -
getFirstFarm
get first farm in the pipeline or null if not- Returns:
- return first farm in the pipeline or null
-
getLastFarm
get last farm in the pipeline or null if not- Returns:
- return last farm in the pipeline or null
-