use of io.trino.metadata.InternalNode in project trino by trinodb.
the class TestRaptorSplitManager method testAssignRandomNodeWhenBackupAvailable.
@Test
public void testAssignRandomNodeWhenBackupAvailable() throws URISyntaxException {
TestingNodeManager nodeManager = new TestingNodeManager();
CatalogName connectorId = new CatalogName("raptor");
NodeSupplier nodeSupplier = nodeManager::getWorkerNodes;
InternalNode node = new InternalNode(UUID.randomUUID().toString(), new URI("http://127.0.0.1/"), NodeVersion.UNKNOWN, false);
nodeManager.addNode(node);
RaptorSplitManager raptorSplitManagerWithBackup = new RaptorSplitManager(connectorId, nodeSupplier, shardManager, true);
deleteShardNodes();
ConnectorSplitSource partitionSplit = getSplits(raptorSplitManagerWithBackup, tableHandle);
List<ConnectorSplit> batch = getSplits(partitionSplit, 1);
assertEquals(getOnlyElement(getOnlyElement(batch).getAddresses()), node.getHostAndPort());
}
use of io.trino.metadata.InternalNode in project trino by trinodb.
the class DistributedQueryRunner method isConnectionVisibleToAllNodes.
private boolean isConnectionVisibleToAllNodes(CatalogName catalogName) {
for (TestingTrinoServer server : servers) {
server.refreshNodes();
Set<InternalNode> activeNodesWithConnector = server.getActiveNodesWithConnector(catalogName);
if (activeNodesWithConnector.size() != servers.size()) {
return false;
}
}
return true;
}
Aggregations