Search in sources :

Example 1 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig in project vespa by vespa-engine.

the class ContentSearchClusterTest method require_that_document_types_with_references_are_topologically_sorted.

@Test
public void require_that_document_types_with_references_are_topologically_sorted() throws Exception {
    ProtonConfig cfg = getProtonConfig(createClusterWithThreeDocumentTypes());
    assertEquals(3, cfg.documentdb().size());
    assertDocumentDb("c", true, cfg.documentdb(0));
    assertDocumentDb("b", true, cfg.documentdb(1));
    assertDocumentDb("a", false, cfg.documentdb(2));
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) Test(org.junit.Test)

Example 2 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig in project vespa by vespa-engine.

the class ContentSearchClusterTest method requireThatGloballyDistributedDocumentTypeIsTaggedAsSuch.

@Test
public void requireThatGloballyDistributedDocumentTypeIsTaggedAsSuch() throws Exception {
    ProtonConfig cfg = getProtonConfig(createClusterWithGlobalType());
    assertEquals(2, cfg.documentdb().size());
    assertDocumentDb("global", true, cfg.documentdb(0));
    assertDocumentDb("regular", false, cfg.documentdb(1));
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) Test(org.junit.Test)

Example 3 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig in project vespa by vespa-engine.

the class ContentSearchClusterTest method assertProtonResourceLimits.

private static void assertProtonResourceLimits(double expDiskLimit, double expMemoryLimits, String clusterXml) throws Exception {
    ProtonConfig cfg = getProtonConfig(createCluster(clusterXml));
    assertEquals(expDiskLimit, cfg.writefilter().disklimit(), EPSILON);
    assertEquals(expMemoryLimits, cfg.writefilter().memorylimit(), EPSILON);
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig)

Example 4 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig in project vespa by vespa-engine.

the class ContentBuilderTest method handleProtonTuning.

@Test
public void handleProtonTuning() throws Exception {
    ContentCluster a = createContent("<content version =\"1.0\" id=\"a\">" + "    <redundancy>3</redundancy>" + "    <engine>" + "      <proton>" + "        <tuning>" + "          <searchnode>" + "            <summary>" + "              <store>" + "                <cache>" + "                  <maxsize>8192</maxsize>" + "                  <compression>" + "                    <type>lz4</type>" + "                    <level>8</level>" + "                  </compression>" + "                </cache>" + "              </store>" + "              <io>" + "                <read>directio</read>" + "              </io>" + "            </summary>" + "          </searchnode>" + "        </tuning>" + "      </proton>" + "    </engine>" + "    <documents>" + "       <document type='music' mode='index'/>" + "    </documents>" + "    <group>" + "      <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + "    </group>" + "</content>");
    assertTrue(a.getPersistence() instanceof ProtonEngine.Factory);
    ProtonConfig.Builder pb = new ProtonConfig.Builder();
    a.getSearch().getConfig(pb);
    List<String> serialize = ConfigInstance.serialize(new ProtonConfig(pb));
    String cfg = StringUtilities.implode(serialize.toArray(new String[serialize.size()]), "\n");
    assertThat(cfg, containsString("summary.cache.maxbytes 8192"));
    assertThat(cfg, containsString("summary.cache.compression.level 8"));
    assertThat(cfg, containsString("summary.cache.compression.type LZ4"));
    assertThat(cfg, containsString("summary.read.io DIRECTIO"));
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) ConfigPayloadBuilder(com.yahoo.vespa.config.ConfigPayloadBuilder) ProtonEngine(com.yahoo.vespa.model.content.engines.ProtonEngine) Matchers.containsString(org.hamcrest.Matchers.containsString) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 5 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig in project vespa by vespa-engine.

the class IndexedSearchNodeNamingTest method assertBaseDir.

private void assertBaseDir(String expected, SearchNode node) {
    ProtonConfig.Builder builder = new ProtonConfig.Builder();
    node.getConfig(builder);
    ProtonConfig cfg = new ProtonConfig(builder);
    assertEquals(expected, cfg.basedir());
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig)

Aggregations

ProtonConfig (com.yahoo.vespa.config.search.core.ProtonConfig)23 Test (org.junit.Test)16 VespaModel (com.yahoo.vespa.model.VespaModel)5 ContentSearchCluster (com.yahoo.vespa.model.content.ContentSearchCluster)4 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)4 VespaModelCreatorWithMockPkg (com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg)4 IndexedSearchCluster (com.yahoo.vespa.model.search.IndexedSearchCluster)3 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)2 ConfigPayloadBuilder (com.yahoo.vespa.config.ConfigPayloadBuilder)2 StorDistributionConfig (com.yahoo.vespa.config.content.StorDistributionConfig)2 AttributesConfig (com.yahoo.vespa.config.search.AttributesConfig)2 ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)2 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Flavor (com.yahoo.config.provision.Flavor)1 IndexInfoConfig (com.yahoo.search.config.IndexInfoConfig)1 IlscriptsConfig (com.yahoo.vespa.configdefinition.IlscriptsConfig)1 ProtonEngine (com.yahoo.vespa.model.content.engines.ProtonEngine)1 VespaModelTester (com.yahoo.vespa.model.test.VespaModelTester)1 Ignore (org.junit.Ignore)1