@Override public Future<?> start() { BatchCoordinator coordinator = createCoordinator(); ExecutorService executor = Executors.newFixedThreadPool(1, "batch coordinator"); try { Future<?> submit = executor.submit(coordinator); return submit; } finally { executor.shutdown(); } }
private synchronized ExecutorService getAsynchIndexingExecutorSynchronized() { ExecutorService executor = asyncIndexingExecutor; if (executor != null) { return executor; } else { this.asyncIndexingExecutor = Executors.newFixedThreadPool( 1, "Index updates queue processor for index " + indexName, maxQueueLength); return this.asyncIndexingExecutor; } }