ExecutorService newFixedThreadPool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1);
CountDownLatch firstIndexerStartingCountdownLatch = new CountDownLatch(1);
crawlersStartedCount = new AtomicInteger(independantPathsToScan.length);
for (String string : independantPathsToScan) {
newFixedThreadPool.submit(new ConcurrentFileCrawler(queue, IndexationConstants.FILTER, new File(string), crawlersStartedCount));
}
for (int i = 0; i < concurrentIndexerCount; i++) {
newFixedThreadPool.submit(new ConcurrentIndexer(queue, documentsIndexed, crawlersStartedCount,firstIndexerStartingCountdownLatch));
}