use of com.facebook.presto.metadata.AllNodes in project presto by prestodb.
the class TestDistributedResourceGroupInfoResource method waitUntilCoordinatorsDiscoveredHealthyInRM.
private void waitUntilCoordinatorsDiscoveredHealthyInRM(long timeoutInMillis) throws TimeoutException, InterruptedException {
long deadline = System.currentTimeMillis() + timeoutInMillis;
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", timeoutInMillis));
}
use of com.facebook.presto.metadata.AllNodes in project presto by prestodb.
the class TestDistributedClusterStatsResource method waitUntilCoordinatorsDiscoveredHealthyInRM.
private void waitUntilCoordinatorsDiscoveredHealthyInRM(long timeoutInMillis) throws TimeoutException, InterruptedException {
long deadline = System.currentTimeMillis() + timeoutInMillis;
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", timeoutInMillis));
}
use of com.facebook.presto.metadata.AllNodes in project presto by prestodb.
the class ConfidenceBasedNodeTtlFetcherManager method refreshTtlInfo.
@VisibleForTesting
public synchronized void refreshTtlInfo() {
AllNodes allNodes = nodeManager.getAllNodes();
refreshTtlInfo(allNodes);
}
use of com.facebook.presto.metadata.AllNodes in project presto by prestodb.
the class TestHiveRecoverableExecution method waitUntilAllNodesAreHealthy.
private static void waitUntilAllNodesAreHealthy(DistributedQueryRunner queryRunner, Duration timeout) throws TimeoutException, InterruptedException {
TestingPrestoServer coordinator = queryRunner.getCoordinator();
long deadline = System.currentTimeMillis() + timeout.toMillis();
while (System.currentTimeMillis() < deadline) {
AllNodes allNodes = coordinator.refreshNodes();
if (allNodes.getActiveNodes().size() == queryRunner.getNodeCount()) {
return;
}
sleep(1000);
}
throw new TimeoutException(format("one of the nodes is still missing after: %s", timeout));
}
use of com.facebook.presto.metadata.AllNodes in project presto by prestodb.
the class NodeSystemTable method cursor.
@Override
public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint) {
Builder table = InMemoryRecordSet.builder(NODES_TABLE);
AllNodes allNodes = nodeManager.getAllNodes();
addRows(table, allNodes.getActiveNodes(), ACTIVE);
addRows(table, allNodes.getInactiveNodes(), INACTIVE);
addRows(table, allNodes.getShuttingDownNodes(), SHUTTING_DOWN);
return table.build().cursor();
}
Aggregations