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);
}
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;
}
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();
}
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);
}
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());
}
Aggregations