use of com.yahoo.config.model.provision.InMemoryProvisioner in project vespa by vespa-engine.
the class StorageNodeTest method getConfig.
private StorDevicesConfig getConfig(boolean useVdsEngine) {
String vdsConfig = useVdsEngine ? " <engine>" + " <vds/>" + " </engine>" : "";
String servicesXml = "<?xml version='1.0' encoding='utf-8' ?>" + "<services version='1.0'>" + " <admin version='2.0'>" + " <adminserver hostalias='node0'/>" + " </admin>" + " <content version='1.0' id='zoo'>" + " <redundancy>1</redundancy>" + " <nodes count='1' />" + " <documents>" + " <document type='type1' mode='streaming' />" + " </documents>" + vdsConfig + " </content>" + "</services>";
List<String> searchDefinitions = ApplicationPackageUtils.generateSearchDefinition("type1");
VespaModelCreatorWithMockPkg modelCreator = new VespaModelCreatorWithMockPkg(null, servicesXml, searchDefinitions);
ApplicationPackage appPkg = modelCreator.appPkg;
boolean failOnOutOfCapacity = true;
InMemoryProvisioner provisioner = new InMemoryProvisioner(failOnOutOfCapacity, "host1.yahoo.com", "host2.yahoo.com");
DeployProperties.Builder builder = new DeployProperties.Builder();
DeployProperties properties = builder.hostedVespa(true).build();
DeployState deployState = new DeployState.Builder().applicationPackage(appPkg).modelHostProvisioner(provisioner).properties(properties).build(true);
VespaModel model = modelCreator.create(true, deployState);
return model.getConfig(StorDevicesConfig.class, "zoo/storage/0");
}
use of com.yahoo.config.model.provision.InMemoryProvisioner in project vespa by vespa-engine.
the class VespaModelTestCase method testNoMultitenantHostExported.
@Test
public void testNoMultitenantHostExported() throws IOException, SAXException {
ApplicationPackage applicationPackage = new MockApplicationPackage.Builder().withServices("<services version='1.0'><admin version='3.0'><nodes count='1' /></admin></services>").build();
DeployState deployState = new DeployState.Builder().applicationPackage(applicationPackage).modelHostProvisioner(new InMemoryProvisioner(true, "host1.yahoo.com")).properties(new DeployProperties.Builder().configServerSpecs(Arrays.asList(new Configserver.Spec("cfghost", 1234, 1235, 1236))).multitenant(true).build()).build(true);
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
AllocatedHosts info = model.allocatedHosts();
assertEquals("Admin version 3 is ignored, and there are no other hosts to borrow for admin services", 0, info.getHosts().size());
}
Aggregations