Search in sources :

Example 36 with ApplicationPackage

use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.

the class CommonVespaModelSetup method createVespaModelWithMusic.

public static VespaModel createVespaModelWithMusic(String hosts, String services) {
    ApplicationPackage app = new MockApplicationPackage.Builder().withHosts(hosts).withServices(services).withSearchDefinition(MockApplicationPackage.MUSIC_SEARCHDEFINITION).build();
    VespaModelCreatorWithMockPkg modelCreator = new VespaModelCreatorWithMockPkg(app);
    return modelCreator.create();
}
Also used : ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage)

Example 37 with ApplicationPackage

use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.

the class SessionFactoryImpl method loadSession.

@Override
public LocalSession loadSession(long sessionId) {
    File sessionDir = getSessionAppDir(sessionId);
    ApplicationPackage applicationPackage = FilesApplicationPackage.fromFile(sessionDir);
    Path sessionIdPath = sessionsPath.append(String.valueOf(sessionId));
    SessionZooKeeperClient sessionZKClient = new SessionZooKeeperClient(curator, configCurator, sessionIdPath, defRepo, serverId, nodeFlavors);
    SessionContext context = new SessionContext(applicationPackage, sessionZKClient, sessionDir, applicationRepo, hostRegistry, superModelGenerationCounter);
    return new LocalSession(tenant, sessionId, sessionPreparer, context);
}
Also used : Path(com.yahoo.path.Path) File(java.io.File) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage)

Example 38 with ApplicationPackage

use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.

the class RemoteSessionTest method require_that_an_application_package_can_limit_to_one_major_version.

@Test
public void require_that_an_application_package_can_limit_to_one_major_version() throws IOException, SAXException {
    ApplicationPackage application = new MockApplicationPackage.Builder().withServices("<services major-version='2' version=\"1.0\"></services>").build();
    MockModelFactory failingFactory = new MockModelFactory();
    failingFactory.vespaVersion = Version.fromIntValues(3, 0, 0);
    failingFactory.throwOnLoad = true;
    MockModelFactory okFactory = new MockModelFactory();
    okFactory.vespaVersion = Version.fromIntValues(2, 0, 0);
    okFactory.throwOnLoad = false;
    SessionZooKeeperClient zkc = new MockSessionZKClient(curator, tenantName, 3, application);
    RemoteSession session = createSession(3, zkc, Arrays.asList(okFactory, failingFactory), failingFactory.clock());
    session.loadPrepared();
// Does not cause an exception because model version 3 is skipped
}
Also used : ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) PermanentApplicationPackage(com.yahoo.vespa.config.server.application.PermanentApplicationPackage) Test(org.junit.Test)

Example 39 with ApplicationPackage

use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.

the class ZooKeeperClientTest method setupZK.

@Before
public void setupZK() throws IOException {
    this.zk = ConfigCurator.create(curator);
    ZooKeeperClient zkc = new ZooKeeperClient(zk, new BaseDeployLogger(), true, Path.fromString(appPath));
    ApplicationPackage app = FilesApplicationPackage.fromFileWithDeployData(new File("src/test/apps/zkfeed"), new DeployData("foo", "/bar/baz", "appName", 1345l, 3l, 2l));
    Map<Version, FileRegistry> fileRegistries = createFileRegistries();
    app.writeMetaData();
    zkc.setupZooKeeper();
    zkc.write(app);
    zkc.write(fileRegistries);
}
Also used : FileRegistry(com.yahoo.config.application.api.FileRegistry) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) ZKApplicationPackage(com.yahoo.vespa.config.server.zookeeper.ZKApplicationPackage) File(java.io.File) Before(org.junit.Before)

Aggregations

ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)39 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)25 Test (org.junit.Test)21 VespaModel (com.yahoo.vespa.model.VespaModel)14 FilesApplicationPackage (com.yahoo.config.model.application.provider.FilesApplicationPackage)13 DeployState (com.yahoo.config.model.deploy.DeployState)12 File (java.io.File)11 NullConfigModelRegistry (com.yahoo.config.model.NullConfigModelRegistry)10 DeployProperties (com.yahoo.config.model.deploy.DeployProperties)8 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)7 InMemoryProvisioner (com.yahoo.config.model.provision.InMemoryProvisioner)6 Matchers.containsString (org.hamcrest.Matchers.containsString)5 VespaModelCreatorWithMockPkg (com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg)4 TestDriver (com.yahoo.config.model.test.TestDriver)3 Path (com.yahoo.path.Path)3 DeployLogger (com.yahoo.config.application.api.DeployLogger)2 MockRoot (com.yahoo.config.model.test.MockRoot)2 Zone (com.yahoo.config.provision.Zone)2 ConfigDefinition (com.yahoo.vespa.config.ConfigDefinition)2 ConfigDefinitionKey (com.yahoo.vespa.config.ConfigDefinitionKey)2