@Internal @ParametersAreNonnullByDefault public class ConcurrentBatchIndexer extends Object implements BatchIndexer
Manages batches of indexable content, and provides progress updates on indexing completion.
Constructor and Description |
---|
ConcurrentBatchIndexer(BatchIndexer delegate,
Integer threadCount,
ConcurrentBatchIndexerExecutorServiceFactory executorServiceFactory) |
Modifier and Type | Method and Description |
---|---|
void |
index(List<HibernateHandle> handles,
ReindexProgress progress) |
protected List<Future<?>> |
submitBatches(ExecutorService executor,
@Nullable List<HibernateHandle> handles,
ReindexProgress progress)
This method tries to work around a number of problems we have with rebuilding the index.
|
public ConcurrentBatchIndexer(BatchIndexer delegate, Integer threadCount, ConcurrentBatchIndexerExecutorServiceFactory executorServiceFactory)
public void index(List<HibernateHandle> handles, ReindexProgress progress)
index
in interface BatchIndexer
protected List<Future<?>> submitBatches(ExecutorService executor, @Nullable List<HibernateHandle> handles, ReindexProgress progress)
More specifically we deal with the following problems 1. Attachments are expensive (memory and CPU) 2. Progress display is Hard (a status update is very fast, compared to say an attachment). By spreading the types out a bit we can get better reporting of how long it will take. 3. OOMEs are a real possibility for naive indexing. 4. Round robin helps even out the work item batches and makes progress estimates more smooth and accurate 5. Variable batch sizes help with controlling Attachment processing and OOME avoidance
Copyright © 2003–2023 Atlassian. All rights reserved.
View cookie preferences