Class ItemizedBatchProcessor<E,B,BC extends ItemizedBatchCollector<B,E>,BJ extends Consumer<B>>

java.lang.Object
uk.ac.ebi.utils.threading.batchproc.BatchProcessor<B,BC,BJ>
uk.ac.ebi.utils.threading.batchproc.ItemizedBatchProcessor<E,B,BC,BJ>
Direct Known Subclasses:
CollectionBasedBatchProcessor

@Deprecated public abstract class ItemizedBatchProcessor<E,B,BC extends ItemizedBatchCollector<B,E>,BJ extends Consumer<B>> extends BatchProcessor<B,BC,BJ>
Deprecated.
the functionality available in this package is provided by project Reactor and we recommend to switch to that. @see ReactorUtils
## Item-based batch processor. This processor implements a complete processing loop, which is based on the common idea of processing a flow of input items and dispatching them to the batches.
Author:
brandizi
Date:
23 Nov 2019
  • Constructor Details

    • ItemizedBatchProcessor

      public ItemizedBatchProcessor(BJ batchJob, BC batchCollector)
      Deprecated.
    • ItemizedBatchProcessor

      public ItemizedBatchProcessor(BJ batchJob)
      Deprecated.
    • ItemizedBatchProcessor

      public ItemizedBatchProcessor()
      Deprecated.
  • Method Details

    • process

      protected void process(Consumer<Consumer<E>> sourceItemsGenerator, boolean waitCompletion)
      Deprecated.
      Gets an input flow of items and dispatches them to batches and batch jobs, as explained in the BatchProcessor super-class.
      Parameters:
      sourceItemsGenerator - this is a consumer of an item consumer, which should yield all the items to be processed and passe each of them to the single-item consumer that we pass it from here. This allows us to collect the generated item, save it the current batch and decide if this has to be dispatched to a new job and a new batch should be generated. In other words, such generator will receive the code that realises the per-item iteration of our hereby processor. This is a generalisation for streams and iterators, we suggest that you use those variants if they fit into your specific case.
      waitCompletion - if true (default), waits for all the submitted batch jobs to complete. You might want this to be false when you use this method to send multiple item sources. **WARNING**: if you do so, **there is no synchronisation** across multiple invocations of this method. For instance, it might be unsafe to switch to a new batch job type, since previous source items might still be bound to the older job.
    • process

      protected void process(Consumer<Consumer<E>> sourceItemsGenerator)
      Deprecated.
      Defaults to true, ie, it waits for all the batches submitted from the source items to be completed.
    • process

      protected void process(Stream<E> sourceItemsGenerator, boolean waitCompletion)
      Deprecated.
      Uses Stream.forEach(Consumer) as generator.
    • process

      protected void process(Stream<E> sourceItemsGenerator)
      Deprecated.
    • process

      protected void process(Iterator<E> sourceItemsGenerator, boolean waitCompletion)
      Deprecated.
    • process

      protected void process(Iterator<E> sourceItemsGenerator)
      Deprecated.