Search in sources :

Example 1 with StorFilestorConfig

use of com.yahoo.vespa.config.content.StorFilestorConfig in project vespa by vespa-engine.

the class ClusterTest method testSearchTuning.

@Test
public void testSearchTuning() throws Exception {
    String xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + "<services>\n" + "\n" + "  <admin version=\"2.0\">\n" + "    <adminserver hostalias=\"node0\" />\n" + "    <cluster-controllers>\n" + "      <cluster-controller hostalias=\"node0\"/>" + "    </cluster-controllers>\n" + "  </admin>\n" + "  <content version='1.0' id='bar'>" + "     <redundancy>1</redundancy>\n" + "     <documents>" + "       <document type=\"type1\" mode='index'/>\n" + "       <document type=\"type2\" mode='index'/>\n" + "     </documents>\n" + "     <group>" + "       <node hostalias='node0' distribution-key='0'/>" + "     </group>" + "    <tuning>\n" + "      <cluster-controller>" + "        <init-progress-time>34567</init-progress-time>" + "      </cluster-controller>" + "    </tuning>" + "   </content>" + "\n" + "</services>";
    List<String> sds = ApplicationPackageUtils.generateSearchDefinitions("type1", "type2");
    VespaModel model = new VespaModelCreatorWithMockPkg(getHosts(), xml, sds).create();
    assertTrue(model.getContentClusters().get("bar").getPersistence() instanceof ProtonEngine.Factory);
    {
        StorDistributormanagerConfig.Builder builder = new StorDistributormanagerConfig.Builder();
        model.getConfig(builder, "bar/distributor/0");
        StorDistributormanagerConfig config = new StorDistributormanagerConfig(builder);
        assertEquals(false, config.inlinebucketsplitting());
    }
    {
        StorFilestorConfig.Builder builder = new StorFilestorConfig.Builder();
        model.getConfig(builder, "bar/storage/0");
        StorFilestorConfig config = new StorFilestorConfig(builder);
        assertEquals(false, config.enable_multibit_split_optimalization());
    }
}
Also used : StorDistributormanagerConfig(com.yahoo.vespa.config.content.core.StorDistributormanagerConfig) StorFilestorConfig(com.yahoo.vespa.config.content.StorFilestorConfig) VespaModelCreatorWithMockPkg(com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg) VespaModel(com.yahoo.vespa.model.VespaModel) SearchDefinitionBuilder(com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder) ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) ProtonEngine(com.yahoo.vespa.model.content.engines.ProtonEngine) Test(org.junit.Test)

Example 2 with StorFilestorConfig

use of com.yahoo.vespa.config.content.StorFilestorConfig in project vespa by vespa-engine.

the class StorageClusterTest method testPersistenceThreads.

@Test
public void testPersistenceThreads() throws Exception {
    StorFilestorConfig.Builder builder = new StorFilestorConfig.Builder();
    parse("<cluster id=\"bees\">\n" + "    <documents/>" + "    <engine>" + "     <vds/>" + "    </engine>" + "    <tuning>\n" + "        <persistence-threads>\n" + "            <thread lowest-priority=\"VERY_LOW\" count=\"2\"/>\n" + "            <thread lowest-priority=\"VERY_HIGH\" count=\"1\"/>\n" + "            <thread count=\"1\"/>\n" + "        </persistence-threads>\n" + "    </tuning>\n" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "  </group>" + "</cluster>").getConfig(builder);
    StorFilestorConfig config = new StorFilestorConfig(builder);
    assertEquals(4, config.num_threads());
    assertEquals(true, config.enable_multibit_split_optimalization());
}
Also used : StorFilestorConfig(com.yahoo.vespa.config.content.StorFilestorConfig) Test(org.junit.Test)

Example 3 with StorFilestorConfig

use of com.yahoo.vespa.config.content.StorFilestorConfig in project vespa by vespa-engine.

the class StorageClusterTest method testNoPersistenceThreads.

@Test
public void testNoPersistenceThreads() throws Exception {
    StorFilestorConfig.Builder builder = new StorFilestorConfig.Builder();
    parse("<cluster id=\"bees\">\n" + "    <documents/>" + "    <tuning>\n" + "    </tuning>\n" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "  </group>" + "</cluster>").getConfig(builder);
    StorFilestorConfig config = new StorFilestorConfig(builder);
    assertEquals(6, config.num_threads());
}
Also used : StorFilestorConfig(com.yahoo.vespa.config.content.StorFilestorConfig) Test(org.junit.Test)

Aggregations

StorFilestorConfig (com.yahoo.vespa.config.content.StorFilestorConfig)3 Test (org.junit.Test)3 StorDistributormanagerConfig (com.yahoo.vespa.config.content.core.StorDistributormanagerConfig)1 VespaModel (com.yahoo.vespa.model.VespaModel)1 ProtonEngine (com.yahoo.vespa.model.content.engines.ProtonEngine)1 ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)1 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)1 VespaModelCreatorWithMockPkg (com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg)1