use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class IndexingModeChangeValidatorTest method testChangingIndexMode.
@Test
public void testChangingIndexMode() throws IOException, SAXException {
ValidationTester tester = new ValidationTester();
VespaModel oldModel = tester.deploy(null, getServices(AbstractSearchCluster.IndexingMode.REALTIME), validationOverrides).getFirst();
List<ConfigChangeAction> changeActions = tester.deploy(oldModel, getServices(AbstractSearchCluster.IndexingMode.STREAMING), validationOverrides).getSecond();
assertRefeedChange(// allowed=true due to validation override
true, "Cluster 'default' changed indexing mode from 'indexed' to 'streaming'", changeActions);
}
use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class ContentBuilderTest method createContent.
private ContentCluster createContent(String xml) throws Exception {
String combined = "" + "<services>" + " <admin version='2.0'>" + " <adminserver hostalias='mockhost'/>" + " </admin>" + xml + "</services>";
VespaModel m = new VespaModelCreatorWithMockPkg(new MockApplicationPackage.Builder().withHosts(getHosts()).withServices(combined).withSearchDefinition(MockApplicationPackage.MUSIC_SEARCHDEFINITION).build()).create();
return m.getContentClusters().isEmpty() ? null : m.getContentClusters().values().iterator().next();
}
use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class IndexingAndDocprocRoutingTest method twoContentTwoDoctypesExplicitIndexingInDifferentIndexingClustersExplicitChainIncorrectInheritance.
@Test(expected = IllegalArgumentException.class)
public void twoContentTwoDoctypesExplicitIndexingInDifferentIndexingClustersExplicitChainIncorrectInheritance() throws IOException, SAXException, ParseException {
final String MUSIC = "musiccluster";
SearchClusterSpec musicCluster = new SearchClusterSpec(MUSIC, "dpmusiccluster", "dpmusicchain");
musicCluster.searchDefs.add(new SearchDefSpec("music", "artist", "album"));
final String BOOKS = "bookscluster";
SearchClusterSpec booksCluster = new SearchClusterSpec(BOOKS, "dpbookscluster", "dpbookschain");
booksCluster.searchDefs.add(new SearchDefSpec("book", "author", "title"));
DocprocClusterSpec dpMusicCluster = new DocprocClusterSpec("dpmusiccluster", new DocprocChainSpec("dpmusicchain"));
DocprocClusterSpec dpBooksCluster = new DocprocClusterSpec("dpbookscluster", new DocprocChainSpec("dpbookschain"));
VespaModel model = getIndexedContentVespaModel(Arrays.asList(dpMusicCluster, dpBooksCluster), Arrays.asList(musicCluster, booksCluster));
// after we generated model, add indexing chains for validation:
dpMusicCluster.chains.clear();
dpMusicCluster.chains.add(new DocprocChainSpec("dpmusiccluster/chain.indexing"));
dpMusicCluster.chains.add(new DocprocChainSpec("dpmusiccluster/chain.dpmusicchain"));
dpBooksCluster.chains.clear();
dpBooksCluster.chains.add(new DocprocChainSpec("dpbookscluster/chain.indexing"));
dpBooksCluster.chains.add(new DocprocChainSpec("dpbookscluster/chain.dpbookschain"));
assertIndexing(model, dpMusicCluster, dpBooksCluster);
assertFeedingRoute(model, MUSIC, "dpmusiccluster/chain.dpmusicchain");
assertFeedingRoute(model, BOOKS, "dpbookscluster/chain.dpbookschain");
}
use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class IndexingAndDocprocRoutingTest method oneSearchOneDoctypeExplicitIndexingClusterExplicitIndexingChain.
@Test
public void oneSearchOneDoctypeExplicitIndexingClusterExplicitIndexingChain() throws IOException, SAXException, ParseException {
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<services version=\"1.0\">\n" + " <admin version=\"2.0\">\n" + " <adminserver hostalias=\"node0\"/> \n" + " </admin>\n" + "\n" + " <content id=\"searchcluster\" version=\"1.0\">\n" + " <redundancy>2</redundancy>\n" + " <documents>\n" + " <document-processing cluster='dpcluster' chain='fooindexing'/>\n" + " <document type=\"music\" mode=\"index\"/>\n" + " </documents>\n" + " <nodes>\n" + " <node hostalias=\"node0\" distribution-key=\"0\"/>\n" + " </nodes>\n" + " </content>\n" + " \n" + " <jdisc version='1.0' id='dpcluster'>\n" + " <document-processing>\n" + " <chain id='fooindexing' inherits='indexing '/>\n" + " </document-processing>\n" + " <nodes>\n" + " <node hostalias='node0'/>\n" + " </nodes>\n" + " <http>\n" + " <server id='dpcluster' port='8000'/>\n" + " </http>\n" + " </jdisc>\n" + "</services>\n";
VespaModel model = getIndexedSearchVespaModel(xml);
assertIndexing(model, new DocprocClusterSpec("dpcluster", new DocprocChainSpec("dpcluster/chain.fooindexing", "indexing"), new DocprocChainSpec("dpcluster/chain.indexing")));
assertFeedingRouteIndexed(model, "searchcluster", "dpcluster/chain.fooindexing");
}
use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class IndexingAndDocprocRoutingTest method twoContentTwoDoctypesImplicitIndexingClusterImplicitIndexingChain.
@Test
public void twoContentTwoDoctypesImplicitIndexingClusterImplicitIndexingChain() throws IOException, SAXException, ParseException {
final String MUSIC = "musiccluster";
SearchClusterSpec musicCluster = new SearchClusterSpec(MUSIC, null, null);
musicCluster.searchDefs.add(new SearchDefSpec("music", "artist", "album"));
final String BOOKS = "bookscluster";
SearchClusterSpec booksCluster = new SearchClusterSpec(BOOKS, null, null);
booksCluster.searchDefs.add(new SearchDefSpec("book", "author", "title"));
VespaModel model = getIndexedContentVespaModel(Collections.<DocprocClusterSpec>emptyList(), Arrays.asList(musicCluster, booksCluster));
assertIndexing(model, new DocprocClusterSpec(MUSIC + ".indexing", new DocprocChainSpec("docproc/cluster." + MUSIC + ".indexing/chain.indexing")), new DocprocClusterSpec(BOOKS + ".indexing", new DocprocChainSpec("docproc/cluster." + BOOKS + ".indexing/chain.indexing")));
assertFeedingRoute(model, MUSIC, "docproc/cluster." + MUSIC + ".indexing/chain.indexing");
assertFeedingRoute(model, BOOKS, "docproc/cluster." + BOOKS + ".indexing/chain.indexing");
}
Aggregations