Search in sources :

Example 1 with NodeSpec

use of com.yahoo.vespa.model.search.NodeSpec in project vespa by vespa-engine.

the class SearchNodeTest method requireThatPreShutdownCommandIsEmptyWhenNotActivated.

@Test
public void requireThatPreShutdownCommandIsEmptyWhenNotActivated() {
    MockRoot root = new MockRoot("");
    SearchNode node = createSearchNode(root, "mynode", 3, new NodeSpec(7, 5), false);
    node.setHostResource(new HostResource(new Host(node, "mynbode")));
    node.initService();
    assertFalse(node.getPreShutdownCommand().isPresent());
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) MockRoot(com.yahoo.config.model.test.MockRoot) NodeSpec(com.yahoo.vespa.model.search.NodeSpec) Host(com.yahoo.vespa.model.Host) SearchNode(com.yahoo.vespa.model.search.SearchNode) Test(org.junit.Test)

Example 2 with NodeSpec

use of com.yahoo.vespa.model.search.NodeSpec in project vespa by vespa-engine.

the class SearchNodeTest method requireThatPreShutdownCommandUsesPrepareRestartWhenActivated.

@Test
public void requireThatPreShutdownCommandUsesPrepareRestartWhenActivated() {
    MockRoot root = new MockRoot("");
    SearchNode node = createSearchNode(root, "mynode2", 4, new NodeSpec(7, 5), true);
    node.setHostResource(new HostResource(new Host(node, "mynbode2")));
    node.initService();
    assertTrue(node.getPreShutdownCommand().isPresent());
    Assert.assertThat(node.getPreShutdownCommand().get(), CoreMatchers.containsString("vespa-proton-cmd " + node.getRpcPort() + " prepareRestart"));
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) MockRoot(com.yahoo.config.model.test.MockRoot) NodeSpec(com.yahoo.vespa.model.search.NodeSpec) Host(com.yahoo.vespa.model.Host) SearchNode(com.yahoo.vespa.model.search.SearchNode) Test(org.junit.Test)

Example 3 with NodeSpec

use of com.yahoo.vespa.model.search.NodeSpec in project vespa by vespa-engine.

the class SearchNodeTest method requireThatBasedirIsCorrectForElasticMode.

@Test
public void requireThatBasedirIsCorrectForElasticMode() {
    MockRoot root = new MockRoot("");
    SearchNode node = createSearchNode(root, "mynode", 3, new NodeSpec(7, 5), false);
    prepare(root, node);
    assertBaseDir(Defaults.getDefaults().underVespaHome("var/db/vespa/search/cluster.mycluster/n3"), node);
}
Also used : MockRoot(com.yahoo.config.model.test.MockRoot) NodeSpec(com.yahoo.vespa.model.search.NodeSpec) SearchNode(com.yahoo.vespa.model.search.SearchNode) Test(org.junit.Test)

Aggregations

MockRoot (com.yahoo.config.model.test.MockRoot)3 NodeSpec (com.yahoo.vespa.model.search.NodeSpec)3 SearchNode (com.yahoo.vespa.model.search.SearchNode)3 Test (org.junit.Test)3 Host (com.yahoo.vespa.model.Host)2 HostResource (com.yahoo.vespa.model.HostResource)2