/** * Start the coordinator with an item processor and a concurrency of 1. * * @param processor the item processor instance that will be used to process each item that has been added * @see #start(ItemProcessor, int, ScatterPolicy) */ public void start(final ItemProcessor<I> processor) { start(processor, 1); }
private void fireStolework(final int itemCount) { for (final ProcessingBucketListener listener : listeners) { listener.stoleWork(itemCount); } }
private void fireStarted() { for (final ProcessingBucketListener listener : listeners) { listener.started(); } }
private int determineBatchSize() { int batchSize = group.getConfig().getBatchSize(); if (quarantined.size() < batchSize) { batchSize = quarantined.size(); } return batchSize; }
private void fireStopped() { for (final ProcessingBucketListener listener : listeners) { listener.stopped(); } } }
void fireStealingDelayed() { for (final ProcessingBucketListener listener : listeners) { listener.stealingDelayed(); } }
private void fireProcessingStarted(final int itemCount) { for (final ProcessingBucketListener listener : listeners) { listener.processingStarted(itemCount); } }
private void fireNothingToProcess() { for (final ProcessingBucketListener listener : listeners) { listener.nothingToProcess(); } }
private void fireProcessingFinished() { for (final ProcessingBucketListener listener : listeners) { listener.processingFinished(); } }
public boolean shouldSteal(final ProcessingBucket<I> victim, final ProcessingBucket<I> thief) { return thief.getLastProcessing() - victim.getLastProcessing() > maxAllowedFallBehind; } }
/** * Start the coordinator with an item processor and a custom concurrency. * * @param processor the item processor instance that will be used to process each item that has been added * @param processingConcurrency the number of buckets that will be created to store the work items * @see #start(ItemProcessor, int, ItemScatterPolicy) */ public void start(final ItemProcessor<I> processor, final int processingConcurrency) { start(processor, processingConcurrency, (ItemScatterPolicy) null); }
private void fireStolework(final int itemCount) { for (final ProcessingBucketListener listener : listeners) { listener.stoleWork(itemCount); } }
private void fireStarted() { for (final ProcessingBucketListener listener : listeners) { listener.started(); } }
private void fireStopped() { for (final ProcessingBucketListener listener : listeners) { listener.stopped(); } } }
void fireStealingDelayed() { for (final ProcessingBucketListener listener : listeners) { listener.stealingDelayed(); } }
private void fireProcessingStarted(final int itemCount) { for (final ProcessingBucketListener listener : listeners) { listener.processingStarted(itemCount); } }
/** * Start the coordinator with an item processor and a custom concurrency. * * @param processor the item processor instance that will be used to process each item that has been added * @param processingConcurrency the number of buckets that will be created to store the work items * @see #start(ItemProcessor, int, ScatterPolicy) */ public void start(final ItemProcessor<I> processor, final int processingConcurrency) { start(processor, processingConcurrency, null); }
/** * Start the coordinator with an item processor and a concurrency of 1. * * @param processor the item processor instance that will be used to process each item that has been added * @see #start(ItemProcessor, int, ItemScatterPolicy) */ public void start(final ItemProcessor<I> processor) { start(processor, 1); }
/** * Start the coordinator with an item processor and a concurrency of 1. * * @param processor the item processor instance that will be used to process each item that has been added * @see #start(ItemProcessor, int, ItemScatterPolicy) */ public void start(final ItemProcessor<I> processor) { start(processor, 1); }
/** * Start the coordinator with an item processor and a custom concurrency. * * @param processor the item processor instance that will be used to process each item that has been added * @param processingConcurrency the number of buckets that will be created to store the work items * @see #start(ItemProcessor, int, ItemScatterPolicy) */ public void start(final ItemProcessor<I> processor, final int processingConcurrency) { start(processor, processingConcurrency, (ItemScatterPolicy) null); }