Search in sources :

Example 1 with NoOpFailureDetector

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));
}
Also used : NoOpFailureDetector(com.facebook.presto.server.NoOpFailureDetector) Node(com.facebook.presto.spi.Node) Test(org.testng.annotations.Test)

Example 2 with NoOpFailureDetector

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));
}
Also used : NoOpFailureDetector(com.facebook.presto.server.NoOpFailureDetector) Test(org.testng.annotations.Test)

Example 3 with NoOpFailureDetector

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);
}
Also used : NoOpFailureDetector(com.facebook.presto.server.NoOpFailureDetector) NodeInfo(io.airlift.node.NodeInfo) Node(com.facebook.presto.spi.Node) NodeConfig(io.airlift.node.NodeConfig) Test(org.testng.annotations.Test)

Aggregations

NoOpFailureDetector (com.facebook.presto.server.NoOpFailureDetector)3 Test (org.testng.annotations.Test)3 Node (com.facebook.presto.spi.Node)2 NodeConfig (io.airlift.node.NodeConfig)1 NodeInfo (io.airlift.node.NodeInfo)1