Search in sources :

Example 1 with ClusterListConfig

use of com.yahoo.cloud.config.ClusterListConfig in project vespa by vespa-engine.

the class VisitorSearcherTestCase method testNoClusterParamWhenSeveralClusters.

@Test(expected = IllegalArgumentException.class)
public void testNoClusterParamWhenSeveralClusters() throws Exception {
    DocumentSessionFactory factory = new DocumentSessionFactory(docType);
    ClusterListConfig.Storage.Builder storageCluster1 = new ClusterListConfig.Storage.Builder().configid("storage/cluster.foo").name("foo");
    ClusterListConfig.Storage.Builder storageCluster2 = new ClusterListConfig.Storage.Builder().configid("storage/cluster.bar").name("bar");
    ClusterListConfig clusterListCfg = new ClusterListConfig(new ClusterListConfig.Builder().storage(Arrays.asList(storageCluster1, storageCluster2)));
    ClusterList clusterList = new ClusterList(clusterListCfg);
    VisitSearcher searcher = new VisitSearcher(new FeedContext(new MessagePropertyProcessor(new FeederConfig(new FeederConfig.Builder().timeout(100).route("whatever").retryenabled(true)), new LoadTypeConfig(new LoadTypeConfig.Builder())), factory, docMan, clusterList, new NullFeedMetric()));
    searcher.getVisitorParameters(newQuery("visit?visit.selection=id.user=1234"), null);
}
Also used : ClusterList(com.yahoo.vespaclient.ClusterList) ClusterListConfig(com.yahoo.cloud.config.ClusterListConfig) FeederConfig(com.yahoo.vespaclient.config.FeederConfig) FeedContext(com.yahoo.feedapi.FeedContext) MessagePropertyProcessor(com.yahoo.feedapi.MessagePropertyProcessor) NullFeedMetric(com.yahoo.feedhandler.NullFeedMetric) LoadTypeConfig(com.yahoo.vespa.config.content.LoadTypeConfig) Test(org.junit.Test)

Example 2 with ClusterListConfig

use of com.yahoo.cloud.config.ClusterListConfig in project vespa by vespa-engine.

the class IndexedTest method requireCorrectClusterList.

@Test
public void requireCorrectClusterList() {
    VespaModel model = getStreamingVespaModel();
    ContentCluster s = model.getContentClusters().get("test");
    assertNotNull(s);
    assertFalse(s.getSearch().hasIndexedCluster());
    ClusterListConfig config = model.getConfig(ClusterListConfig.class, VespaModel.ROOT_CONFIGID);
    assertThat(config.storage().size(), is(1));
    assertThat(config.storage(0).name(), is("test"));
    assertThat(config.storage(0).configid(), is("test"));
}
Also used : VespaModel(com.yahoo.vespa.model.VespaModel) ClusterListConfig(com.yahoo.cloud.config.ClusterListConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 3 with ClusterListConfig

use of com.yahoo.cloud.config.ClusterListConfig in project vespa by vespa-engine.

the class VisitorSearcherTestCase method create.

public VisitSearcher create() throws Exception {
    ClusterListConfig.Storage.Builder storageCluster = new ClusterListConfig.Storage.Builder().configid("storage/cluster.foobar").name("foobar");
    ClusterListConfig clusterListCfg = new ClusterListConfig(new ClusterListConfig.Builder().storage(storageCluster));
    ClusterList clusterList = new ClusterList(clusterListCfg);
    return new VisitSearcher(new FeedContext(new MessagePropertyProcessor(new FeederConfig(new FeederConfig.Builder().timeout(458).route("riksveg18").retryenabled(true)), new LoadTypeConfig(new LoadTypeConfig.Builder())), factory, docMan, clusterList, new NullFeedMetric()));
}
Also used : ClusterList(com.yahoo.vespaclient.ClusterList) FeedContext(com.yahoo.feedapi.FeedContext) ClusterListConfig(com.yahoo.cloud.config.ClusterListConfig) FeederConfig(com.yahoo.vespaclient.config.FeederConfig) MessagePropertyProcessor(com.yahoo.feedapi.MessagePropertyProcessor) NullFeedMetric(com.yahoo.feedhandler.NullFeedMetric) LoadTypeConfig(com.yahoo.vespa.config.content.LoadTypeConfig)

Aggregations

ClusterListConfig (com.yahoo.cloud.config.ClusterListConfig)3 FeedContext (com.yahoo.feedapi.FeedContext)2 MessagePropertyProcessor (com.yahoo.feedapi.MessagePropertyProcessor)2 NullFeedMetric (com.yahoo.feedhandler.NullFeedMetric)2 LoadTypeConfig (com.yahoo.vespa.config.content.LoadTypeConfig)2 ClusterList (com.yahoo.vespaclient.ClusterList)2 FeederConfig (com.yahoo.vespaclient.config.FeederConfig)2 Test (org.junit.Test)2 VespaModel (com.yahoo.vespa.model.VespaModel)1 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)1