Search in sources :

Example 1 with DeployProperties

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);
}
Also used : SingleNodeProvisioner(com.yahoo.config.model.provision.SingleNodeProvisioner) VespaModelCreatorWithMockPkg(com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg) DeployState(com.yahoo.config.model.deploy.DeployState) InMemoryProvisioner(com.yahoo.config.model.provision.InMemoryProvisioner) DeployProperties(com.yahoo.config.model.deploy.DeployProperties) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) HostProvisioner(com.yahoo.config.model.api.HostProvisioner)

Example 2 with DeployProperties

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");
}
Also used : VespaModelCreatorWithMockPkg(com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg) DeployState(com.yahoo.config.model.deploy.DeployState) InMemoryProvisioner(com.yahoo.config.model.provision.InMemoryProvisioner) DeployProperties(com.yahoo.config.model.deploy.DeployProperties) VespaModel(com.yahoo.vespa.model.VespaModel) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage)

Aggregations

ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)2 DeployProperties (com.yahoo.config.model.deploy.DeployProperties)2 DeployState (com.yahoo.config.model.deploy.DeployState)2 InMemoryProvisioner (com.yahoo.config.model.provision.InMemoryProvisioner)2 VespaModelCreatorWithMockPkg (com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg)2 HostProvisioner (com.yahoo.config.model.api.HostProvisioner)1 SingleNodeProvisioner (com.yahoo.config.model.provision.SingleNodeProvisioner)1 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)1 VespaModel (com.yahoo.vespa.model.VespaModel)1