public synchronized void reconfigure(Collection<T> nodes) {
        if ( ! monitorThread.isAlive()) throw new IllegalStateException("monitor thread must be alive for reconfiguration");

        nodesToUpdate.addAll(nodes);
        nodesToRemove.addAll(nodeMonitors.keySet());
        nodesToRemove.removeAll(nodes);
        for (T node : nodes) if ( ! nodeMonitors.containsKey(node)) add(node, true);

        synchronized (nodeManager) { skipNextWait = true; nodeManager.notifyAll(); }
        try { while ( ! nodesToRemove.isEmpty() || ! nodesToUpdate.isEmpty()) wait(1); }
        catch (InterruptedException e) { throw new UncheckedInterruptedException(e, true); }

        nodeManager.pingIterationCompleted();
    }
Updates the monitored set of nodes, and waits for 1. data on new nodes, and 2. RPC completion of removed nodes.
container-search/src/main/java/com/yahoo/search/cluster/ClusterMonitor.java