use of com.facebook.presto.metadata.AllNodes in project presto by prestodb.
the class TestDistributedQueryInfoResource method waitUntilCoordinatorsDiscoveredHealthyInRM.
private void waitUntilCoordinatorsDiscoveredHealthyInRM(long timeoutInMilis) throws TimeoutException, InterruptedException {
long deadline = System.currentTimeMillis() + timeoutInMilis;
while (System.currentTimeMillis() < deadline) {
AllNodes allNodes = this.resourceManager.refreshNodes();
if (allNodes.getActiveCoordinators().size() == COORDINATOR_COUNT) {
return;
}
sleep(100);
}
throw new TimeoutException(format("one of the nodes is still missing after: %s ms", timeoutInMilis));
}
Aggregations