* if interrupted while waiting for endAllSignal.
*/
private void doBatchWork(BatchBackend backend) throws InterruptedException {
ExecutorService executor = Executors.newFixedThreadPool( typesToIndexInParallel, "BatchIndexingWorkspace" );
for ( Class<?> type : rootEntities ) {
executor.execute( new BatchIndexingWorkspace( gridDialect, searchFactoryImplementor, sessionFactory, type,
cacheMode, endAllSignal, monitor, backend ) );
}
executor.shutdown();
endAllSignal.await(); // waits for the executor to finish
}