use of com.yahoo.vespa.model.HostResource in project vespa by vespa-engine.
the class IndexedTest method requireProtonStreamingOnly.
@Test
public void requireProtonStreamingOnly() {
VespaModel model = getStreamingVespaModel();
HostResource h = model.getHostSystem().getHosts().get(0);
String[] expectedServices = { "logserver", "configserver", "adminserver", "slobrok", "logd", "configproxy", "config-sentinel", "qrserver", "storagenode", "searchnode", "distributor", "transactionlogserver" };
// TODO DomContentBuilderTest.assertServices(h, expectedServices);
ContentCluster s = model.getContentClusters().get("test");
assertFalse(s.getSearch().hasIndexedCluster());
StorServerConfig.Builder builder = new StorServerConfig.Builder();
s.getStorageNodes().getConfig(builder);
s.getStorageNodes().getChildren().get("3").getConfig(builder);
}
use of com.yahoo.vespa.model.HostResource in project vespa by vespa-engine.
the class DomAdminBuilderBase method getConfigServersFromSpec.
List<Configserver> getConfigServersFromSpec(AbstractConfigProducer parent) {
List<Configserver> configservers = new ArrayList<>();
for (ConfigServerSpec spec : configServerSpecs) {
HostSystem hostSystem = parent.getHostSystem();
HostResource host = new HostResource(Host.createConfigServerHost(hostSystem, spec.getHostName()));
hostSystem.addBoundHost(host);
Configserver configserver = new Configserver(parent, spec.getHostName());
configserver.setHostResource(host);
configserver.setBasePort(configserver.getWantedPort());
configserver.initService();
configservers.add(configserver);
}
return configservers;
}
use of com.yahoo.vespa.model.HostResource in project vespa by vespa-engine.
the class ContainerModelBuilder method createNodesFromNodeCount.
private List<Container> createNodesFromNodeCount(ContainerCluster cluster, Element nodesElement, ConfigModelContext context) {
NodesSpecification nodesSpecification = NodesSpecification.from(new ModelElement(nodesElement), context.getDeployState().getWantedNodeVespaVersion());
Map<HostResource, ClusterMembership> hosts = nodesSpecification.provision(cluster.getRoot().getHostSystem(), ClusterSpec.Type.container, ClusterSpec.Id.from(cluster.getName()), log);
return createNodesFromHosts(hosts, cluster);
}
use of com.yahoo.vespa.model.HostResource in project vespa by vespa-engine.
the class ContainerModelBuilder method createNodesFromNodeType.
private List<Container> createNodesFromNodeType(ContainerCluster cluster, Element nodesElement, ConfigModelContext context) {
NodeType type = NodeType.valueOf(nodesElement.getAttribute("type"));
ClusterSpec clusterSpec = ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from(cluster.getName()), context.getDeployState().getWantedNodeVespaVersion(), false);
Map<HostResource, ClusterMembership> hosts = cluster.getRoot().getHostSystem().allocateHosts(clusterSpec, Capacity.fromRequiredNodeType(type), 1, log);
return createNodesFromHosts(hosts, cluster);
}
use of com.yahoo.vespa.model.HostResource in project vespa by vespa-engine.
the class ContainerModelBuilder method createNodesFromContentServiceReference.
private List<Container> createNodesFromContentServiceReference(ContainerCluster cluster, Element nodesElement, ConfigModelContext context) {
// Resolve references to content clusters at the XML level because content clusters must be built after container clusters
String referenceId = nodesElement.getAttribute("of");
Element services = servicesRootOf(nodesElement).orElseThrow(() -> clusterReferenceNotFoundException(cluster, referenceId));
Element referencedService = findChildById(services, referenceId).orElseThrow(() -> clusterReferenceNotFoundException(cluster, referenceId));
if (!referencedService.getTagName().equals("content"))
throw new IllegalArgumentException(cluster + " references service '" + referenceId + "', " + "but that is not a content service");
Element referencedNodesElement = XML.getChild(referencedService, "nodes");
if (referencedNodesElement == null)
throw new IllegalArgumentException(cluster + " references service '" + referenceId + "' to supply nodes, " + "but that service has no <nodes> element");
cluster.setHostClusterId(referenceId);
Map<HostResource, ClusterMembership> hosts = StorageGroup.provisionHosts(NodesSpecification.from(new ModelElement(referencedNodesElement), context.getDeployState().getWantedNodeVespaVersion()), referenceId, cluster.getRoot().getHostSystem(), context.getDeployLogger());
return createNodesFromHosts(hosts, cluster);
}
Aggregations