Search in sources :

Example 1 with Host

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

the class ContainerClusterTest method addContainer.

private static void addContainer(ContainerCluster cluster, String name, String hostName) {
    Container container = new Container(cluster, name, 0);
    container.setHostResource(new HostResource(new Host(null, hostName)));
    container.initService();
    cluster.addContainer(container);
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) Host(com.yahoo.vespa.model.Host)

Example 2 with Host

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

the class MultilevelDispatchTest method createCluster.

private ContentCluster createCluster(String dispatchXml) throws Exception {
    String[] hosts = { "mh0", "mh1", "mh2", "mh3", "mh4", "mh5" };
    MockRoot root = ContentClusterUtils.createMockRoot(hosts);
    ContentCluster cluster = ContentClusterUtils.createCluster(createClusterXml(getGroupXml(), Optional.of(dispatchXml), 1, 1), root);
    AbstractConfigProducer<Dispatch> dispatchParent = new SimpleConfigProducer<>(root, "tlds");
    HostResource hostResource = new HostResource(new Host(root, "mockhost"));
    IndexedSearchCluster index = cluster.getSearch().getIndexed();
    index.addTld(dispatchParent, hostResource);
    index.setupDispatchGroups();
    root.freezeModelTopology();
    cluster.validate();
    return cluster;
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) MockRoot(com.yahoo.config.model.test.MockRoot) SimpleConfigProducer(com.yahoo.vespa.model.SimpleConfigProducer) Host(com.yahoo.vespa.model.Host) Matchers.containsString(org.hamcrest.Matchers.containsString) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster)

Example 3 with Host

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

the class SearchNodeTest method prepare.

private void prepare(MockRoot root, SearchNode node) {
    Host host = new Host(root, "mockhost");
    TransactionLogServer tls = new TransactionLogServer(root, "mycluster");
    tls.setHostResource(new HostResource(host));
    tls.setBasePort(100);
    tls.initService();
    node.setTls(tls);
    node.setHostResource(new HostResource(host));
    node.setBasePort(200);
    node.initService();
    root.freezeModelTopology();
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) TransactionLogServer(com.yahoo.vespa.model.search.TransactionLogServer) Host(com.yahoo.vespa.model.Host)

Example 4 with Host

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

the class ContainerClusterTest method addClusterController.

private static void addClusterController(ContainerCluster cluster, String hostName) {
    Container container = new ClusterControllerContainer(cluster, 1, false);
    container.setHostResource(new HostResource(new Host(null, hostName)));
    container.initService();
    cluster.addContainer(container);
}
Also used : ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) HostResource(com.yahoo.vespa.model.HostResource) ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) Host(com.yahoo.vespa.model.Host)

Example 5 with Host

use of com.yahoo.vespa.model.Host 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)

Aggregations

Host (com.yahoo.vespa.model.Host)6 HostResource (com.yahoo.vespa.model.HostResource)6 MockRoot (com.yahoo.config.model.test.MockRoot)3 ClusterControllerContainer (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer)2 NodeSpec (com.yahoo.vespa.model.search.NodeSpec)2 SearchNode (com.yahoo.vespa.model.search.SearchNode)2 Test (org.junit.Test)2 SimpleConfigProducer (com.yahoo.vespa.model.SimpleConfigProducer)1 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)1 TransactionLogServer (com.yahoo.vespa.model.search.TransactionLogServer)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1