Search in sources :

Example 1 with StorDistributormanagerConfig

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

the class ClusterTest method assertDistributionBitsInConfig.

private void assertDistributionBitsInConfig(ContentCluster cluster, int distributionBits) {
    FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder();
    cluster.getConfig(builder);
    cluster.getClusterControllerConfig().getConfig(builder);
    FleetcontrollerConfig config = new FleetcontrollerConfig(builder);
    assertEquals(distributionBits, config.ideal_distribution_bits());
    StorDistributormanagerConfig.Builder sdBuilder = new StorDistributormanagerConfig.Builder();
    cluster.getConfig(sdBuilder);
    StorDistributormanagerConfig storDistributormanagerConfig = new StorDistributormanagerConfig(sdBuilder);
    assertEquals(distributionBits, storDistributormanagerConfig.minsplitcount());
}
Also used : StorDistributormanagerConfig(com.yahoo.vespa.config.content.core.StorDistributormanagerConfig) SearchDefinitionBuilder(com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder) ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) FleetcontrollerConfig(com.yahoo.vespa.config.content.FleetcontrollerConfig)

Example 2 with StorDistributormanagerConfig

use of com.yahoo.vespa.config.content.core.StorDistributormanagerConfig 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 3 with StorDistributormanagerConfig

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

the class DistributorTest method testGarbageCollectionInterval.

@Test
public void testGarbageCollectionInterval() {
    StorDistributormanagerConfig.Builder builder = new StorDistributormanagerConfig.Builder();
    parse("<cluster id=\"storage\">\n" + "  <documents garbage-collection=\"true\" garbage-collection-interval=\"30\">\n" + "    <document type=\"music\"/>\n" + "  </documents>\n" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "  </group>" + "</cluster>").getConfig(builder);
    StorDistributormanagerConfig conf = new StorDistributormanagerConfig(builder);
    assertEquals(30, conf.garbagecollection().interval());
}
Also used : StorDistributormanagerConfig(com.yahoo.vespa.config.content.core.StorDistributormanagerConfig) Test(org.junit.Test)

Example 4 with StorDistributormanagerConfig

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

the class DistributorTest method bucket_activation_enabled_with_single_indexed_document.

@Test
public void bucket_activation_enabled_with_single_indexed_document() {
    StorDistributormanagerConfig config = clusterXmlToConfig(generateXmlForDocTypes(DocType.index("music")));
    assertThat(config.disable_bucket_activation(), is(false));
}
Also used : StorDistributormanagerConfig(com.yahoo.vespa.config.content.core.StorDistributormanagerConfig) Test(org.junit.Test)

Example 5 with StorDistributormanagerConfig

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

the class DistributorTest method bucket_activation_disabled_if_no_documents_in_indexed_mode.

@Test
public void bucket_activation_disabled_if_no_documents_in_indexed_mode() {
    StorDistributormanagerConfig config = clusterXmlToConfig(generateXmlForDocTypes(DocType.storeOnly("music")));
    assertThat(config.disable_bucket_activation(), is(true));
}
Also used : StorDistributormanagerConfig(com.yahoo.vespa.config.content.core.StorDistributormanagerConfig) Test(org.junit.Test)

Aggregations

StorDistributormanagerConfig (com.yahoo.vespa.config.content.core.StorDistributormanagerConfig)15 Test (org.junit.Test)14 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)2 ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)2 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)2 FleetcontrollerConfig (com.yahoo.vespa.config.content.FleetcontrollerConfig)1 StorFilestorConfig (com.yahoo.vespa.config.content.StorFilestorConfig)1 VespaModel (com.yahoo.vespa.model.VespaModel)1 ProtonEngine (com.yahoo.vespa.model.content.engines.ProtonEngine)1 VespaModelCreatorWithMockPkg (com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg)1