use of com.yahoo.vespa.model.search.SearchNode 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());
}
use of com.yahoo.vespa.model.search.SearchNode 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"));
}
use of com.yahoo.vespa.model.search.SearchNode 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);
}
Aggregations