use of com.yahoo.config.model.deploy.DeployProperties in project vespa by vespa-engine.
the class VespaModelTester method createModel.
/**
* Creates a model using the hosts already added to this
*
* @param services the services xml string
* @param failOnOutOfCapacity whether we should get an exception when not enough hosts of the requested flavor
* is available or if we should just silently receive a smaller allocation
* @return the resulting model
*/
public VespaModel createModel(String services, boolean failOnOutOfCapacity, int startIndexForClusters, String... retiredHostNames) {
VespaModelCreatorWithMockPkg modelCreatorWithMockPkg = new VespaModelCreatorWithMockPkg(null, services, ApplicationPackageUtils.generateSearchDefinition("type1"));
ApplicationPackage appPkg = modelCreatorWithMockPkg.appPkg;
HostProvisioner provisioner = hosted ? new InMemoryProvisioner(hostsByFlavor, failOnOutOfCapacity, startIndexForClusters, retiredHostNames) : new SingleNodeProvisioner();
DeployProperties properties = new DeployProperties.Builder().hostedVespa(hosted).applicationId(applicationId).build();
DeployState deployState = new DeployState.Builder().applicationPackage(appPkg).modelHostProvisioner(provisioner).properties(properties).build(true);
return modelCreatorWithMockPkg.create(false, deployState, configModelRegistry);
}
use of com.yahoo.config.model.deploy.DeployProperties 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");
}
Aggregations