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();
}
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);
}
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
}
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);
}
Aggregations