/** * Gets the data of the node, blocking until the node is available. * * @return data of the node * @throws InterruptedException if the waiting thread is interrupted */ public synchronized byte[] blockUntilAvailable() throws InterruptedException { return blockUntilAvailable(0, false); }
/** * Utilty method to wait indefinitely on a znode availability while checking * if the fserver is shut down * * @param tracker * znode tracker to use * @throws java.io.IOException * any IO exception, plus if the RS is stopped * @throws InterruptedException */ private void blockAndCheckIfStopped(ZooKeeperNodeTracker tracker) throws IOException, InterruptedException { while (tracker.blockUntilAvailable(this.msgInterval, false) == null) { if (this.stopped) { throw new IOException("Received the shutdown message while waiting."); } } }