/** * Blocks the calling thread until the index is ready. */ public void waitForReady() { if (!isReady()) { try { Barrier b = Barrier.create(); b.add(readyFuture); b.await(); } catch (InterruptedException e) { Exceptions.ignore(e); Thread.currentThread().interrupt(); } } } }