Package bbflow

Class ff_pipeline<T,V>

java.lang.Object
bbflow.block<T,U>
bbflow.ff_node<T,V>
bbflow.ff_pipeline<T,V>

public class ff_pipeline<T,V> extends ff_node<T,V>
Pipeline building block allows auto-connection between all types of ff_blocks
  • Field Details

    • pipe

    • bufferSize

      int bufferSize
    • TYPE_1_1

      public static byte TYPE_1_1
      one 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_1xN
      N 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_Nx1
      N 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_N
      N 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_NxM
      connect all N workers from left to all M workers from right.
  • Constructor Details

    • ff_pipeline

      public ff_pipeline(block<T,Object> b1, block<Object,V> b2)
      constructor of pipeline between two blocks of type 1-1 (one channel created between b1 and b2)
      Parameters:
      b1 - first block
      b2 - second block
    • ff_pipeline

      public ff_pipeline(block<T,Object> b1, block<Object,V> b2, int bufferSize)
      constructor of pipeline between two blocks of type 1-1 (one channel created between b1 and b2)
      Parameters:
      b1 - first block
      b2 - second block
      bufferSize - buffer size of the channel
    • ff_pipeline

      public ff_pipeline(block<T,Object> b1, block<Object,V> b2, byte MULTI)
      constructor of pipeline between two blocks of type MULTI (see types)
      Parameters:
      b1 - first block
      b2 - second block
      MULTI - TYPE_1_1, TYPE_1_N, TYPE_Nx1, TYPE_N_N, TYPE_NxM
    • ff_pipeline

      public ff_pipeline(block<T,Object> b1, block<Object,V> b2, int bufferSize, byte MULTI)
      constructor of pipeline between two blocks of type MULTI (see types)
      Parameters:
      b1 - first block
      b2 - second block
      bufferSize - buffer size of the channels
      MULTI - TYPE_1_1, TYPE_1_N, TYPE_Nx1, TYPE_N_N, TYPE_NxM
  • Method Details

    • preload

      public static void preload()
    • appendBlock

      public void appendBlock(block<Object,Object> newblock, byte MULTI)
      append a new block to pipeline connected
      Parameters:
      newblock -
      MULTI -
    • appendBlock

      public void appendBlock(block<Object,Object> newblock)
      append a new block to pipeline connected
      Parameters:
      newblock -
    • addInputChannel

      public void addInputChannel(ff_queue<T> input)
      add a new input channel to the first block of the pipeline
      Overrides:
      addInputChannel in class ff_node<T,V>
      Parameters:
      input - input channel
    • addOutputChannel

      public void addOutputChannel(ff_queue<V> output)
      add a new output channel to the last block of the pipeline
      Overrides:
      addOutputChannel in class ff_node<T,V>
      Parameters:
      output - output channel
    • start

      public void start()
      start all blocks in the pipeline
      Overrides:
      start in class ff_node<T,V>
    • join

      public void join()
      wait end of all blocks in the pipeline
      Overrides:
      join in class ff_node<T,V>
    • getFirstFarm

      public ff_farm getFirstFarm()
      get first farm in the pipeline or null if not
      Returns:
      return first farm in the pipeline or null
    • getLastFarm

      public ff_farm getLastFarm()
      get last farm in the pipeline or null if not
      Returns:
      return last farm in the pipeline or null