use of com.facebook.presto.server.NoOpFailureDetector in project presto by prestodb.
the class TestDiscoveryNodeManager method testGetAllNodes.
@Test
public void testGetAllNodes() throws Exception {
DiscoveryNodeManager manager = new DiscoveryNodeManager(selector, nodeInfo, new NoOpFailureDetector(), expectedVersion, testHttpClient);
AllNodes allNodes = manager.getAllNodes();
Set<Node> activeNodes = allNodes.getActiveNodes();
assertEqualsIgnoreOrder(activeNodes, this.activeNodes);
for (Node actual : activeNodes) {
for (Node expected : this.activeNodes) {
assertNotSame(actual, expected);
}
}
assertEqualsIgnoreOrder(activeNodes, manager.getNodes(ACTIVE));
Set<Node> inactiveNodes = allNodes.getInactiveNodes();
assertEqualsIgnoreOrder(inactiveNodes, this.inactiveNodes);
for (Node actual : inactiveNodes) {
for (Node expected : this.inactiveNodes) {
assertNotSame(actual, expected);
}
}
assertEqualsIgnoreOrder(inactiveNodes, manager.getNodes(INACTIVE));
}
use of com.facebook.presto.server.NoOpFailureDetector in project presto by prestodb.
the class TestDiscoveryNodeManager method testGetCoordinators.
@Test
public void testGetCoordinators() throws Exception {
InternalNodeManager manager = new DiscoveryNodeManager(selector, nodeInfo, new NoOpFailureDetector(), expectedVersion, testHttpClient);
assertEquals(manager.getCoordinators(), ImmutableSet.of(coordinator));
}
use of com.facebook.presto.server.NoOpFailureDetector in project presto by prestodb.
the class TestDiscoveryNodeManager method testGetCurrentNode.
@Test
public void testGetCurrentNode() {
Node expected = activeNodes.get(0);
NodeInfo nodeInfo = new NodeInfo(new NodeConfig().setEnvironment("test").setNodeId(expected.getNodeIdentifier()));
DiscoveryNodeManager manager = new DiscoveryNodeManager(selector, nodeInfo, new NoOpFailureDetector(), expectedVersion, testHttpClient);
assertEquals(manager.getCurrentNode(), expected);
}
Aggregations