Search in sources :

Example 6 with AllNodes

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));
}
Also used : AllNodes(com.facebook.presto.metadata.AllNodes) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

AllNodes (com.facebook.presto.metadata.AllNodes)6 TimeoutException (java.util.concurrent.TimeoutException)4 TableMetadataBuilder.tableMetadataBuilder (com.facebook.presto.metadata.MetadataUtil.TableMetadataBuilder.tableMetadataBuilder)1 TestingPrestoServer (com.facebook.presto.server.testing.TestingPrestoServer)1 Builder (com.facebook.presto.spi.InMemoryRecordSet.Builder)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1