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
-
Field Summary
Fields inherited from class uk.ac.ebi.utils.threading.batchproc.BatchProcessor
jobLogPeriod, log
-
Constructor Summary
ConstructorDescriptionDeprecated.ItemizedBatchProcessor
(BJ batchJob) Deprecated.ItemizedBatchProcessor
(BJ batchJob, BC batchCollector) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Deprecated.Defaults to true, ie, it waits for all the batches submitted from the source items to be completed.protected void
Deprecated.Gets an input flow of items and dispatches them to batches and batch jobs, as explained in theBatchProcessor
super-class.protected void
Deprecated.protected void
Deprecated.UsesIterator.forEachRemaining(Consumer)
as generator.protected void
Deprecated.protected void
Deprecated.UsesStream.forEach(Consumer)
as generator.Methods inherited from class uk.ac.ebi.utils.threading.batchproc.BatchProcessor
getBatchCollector, getBatchJob, getCompletedBatches, getExecutor, getSubmittedBatches, handleNewBatch, handleNewBatch, setBatchCollector, setBatchJob, setExecutor, setJobLogPeriod, waitExecutor, wrapBatchJob
-
Constructor Details
-
ItemizedBatchProcessor
Deprecated. -
ItemizedBatchProcessor
Deprecated. -
ItemizedBatchProcessor
public ItemizedBatchProcessor()Deprecated.
-
-
Method Details
-
process
Deprecated.Gets an input flow of items and dispatches them to batches and batch jobs, as explained in theBatchProcessor
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 forstreams
anditerators
, 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 toswitch to a new batch job type
, since previous source items might still be bound to the older job.
-
process
Deprecated.Defaults to true, ie, it waits for all the batches submitted from the source items to be completed. -
process
Deprecated.UsesStream.forEach(Consumer)
as generator. -
process
Deprecated. -
process
Deprecated.UsesIterator.forEachRemaining(Consumer)
as generator. -
process
Deprecated.
-