Sounds great
maybe it could be a nice feature to make it possible to choose if you would like to run root entity indexers in parallel or sequentially.
on the MassIndexer there could be an extra method: runRootIndexersSequentially() (or at better name) and then in the BatchCoordinator there could be something like:
private void doBatchWork(BatchBackend backend) throws InterruptedException {
int poolSize = rootEntities.lengh;
if (runRootIndexersSequentially) {
poolSize = 1;
}
ExecutorService executor = Executors.newFixedThreadPool(poolSize, "BatchIndexingWorkspace");
}
maybe then the creation of the ThreadPool's in BatchIndexingWorkspace should wait until run(), so there want be created a lot of threads until they are needed.
What do you think?
Have a nice vacation
|