Search in sources :

Example 6 with FleetcontrollerConfig

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

the class ClusterControllerTestCase method testUnconfigured.

@Test
public void testUnconfigured() throws Exception {
    String xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + "<services>\n" + "\n" + "  <admin version=\"2.0\">\n" + "    <adminserver hostalias=\"configserver\" />\n" + "    <logserver hostalias=\"logserver\" />\n" + "    <slobroks>\n" + "      <slobrok hostalias=\"configserver\" />\n" + "      <slobrok hostalias=\"logserver\" />\n" + "    </slobroks>\n" + "  </admin>\n" + "  <content version='1.0' id='bar'>" + "     <redundancy>1</redundancy>\n" + "     <documents>" + "       <document type=\"type1\" mode=\"store-only\"/>\n" + "     </documents>\n" + "     <group>" + "       <node hostalias='node0' distribution-key='0' />" + "     </group>" + "    <tuning>" + "      <cluster-controller>\n" + "        <init-progress-time>34567</init-progress-time>" + "      </cluster-controller>" + "    </tuning>" + "   </content>" + "\n" + "</services>";
    VespaModel model = createVespaModel(xml);
    assertTrue(model.getService("admin/cluster-controllers/0").isPresent());
    assertTrue(existsHostsWithClusterControllerConfigId(model));
    assertGroupSize(model, "admin/cluster-controllers/0/components/clustercontroller-bar-configurer", 1);
    assertThat(model.getAdmin().getClusterControllers().getContainers().size(), is(1));
    FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder();
    model.getConfig(builder, "admin/cluster-controllers/0/components/clustercontroller-bar-configurer");
    FleetcontrollerConfig cfg = new FleetcontrollerConfig(builder);
    assertThat(cfg.index(), is(0));
    assertThat(cfg.fleet_controller_count(), is(1));
    assertThat(cfg.init_progress_time(), is(34567000));
}
Also used : VespaModel(com.yahoo.vespa.model.VespaModel) FleetcontrollerConfig(com.yahoo.vespa.config.content.FleetcontrollerConfig) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 7 with FleetcontrollerConfig

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

the class FleetControllerClusterTest method min_node_ratio_per_group_tuning_config_is_propagated.

@Test
public void min_node_ratio_per_group_tuning_config_is_propagated() {
    FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder();
    parse("<cluster id=\"storage\">\n" + "  <documents/>\n" + "  <tuning>\n" + "    <min-node-ratio-per-group>0.75</min-node-ratio-per-group>\n" + "  </tuning>\n" + "</cluster>").getConfig(builder);
    FleetcontrollerConfig config = new FleetcontrollerConfig(builder);
    assertEquals(0.75, config.min_node_ratio_per_group(), 0.01);
}
Also used : FleetcontrollerConfig(com.yahoo.vespa.config.content.FleetcontrollerConfig) Test(org.junit.Test)

Example 8 with FleetcontrollerConfig

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

the class FleetControllerClusterTest method min_node_ratio_per_group_is_implicitly_zero_when_omitted.

@Test
public void min_node_ratio_per_group_is_implicitly_zero_when_omitted() {
    FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder();
    parse("<cluster id=\"storage\">\n" + "  <documents/>\n" + "</cluster>").getConfig(builder);
    FleetcontrollerConfig config = new FleetcontrollerConfig(builder);
    assertEquals(0.0, config.min_node_ratio_per_group(), 0.01);
}
Also used : FleetcontrollerConfig(com.yahoo.vespa.config.content.FleetcontrollerConfig) Test(org.junit.Test)

Example 9 with FleetcontrollerConfig

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

the class ClusterControllerTestCase method testUnconfiguredNoTuning.

@Test
public void testUnconfiguredNoTuning() throws Exception {
    String xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + "<services>\n" + "\n" + "  <admin version=\"2.0\">\n" + "    <adminserver hostalias=\"configserver\" />\n" + "    <logserver hostalias=\"logserver\" />\n" + "    <slobroks>\n" + "      <slobrok hostalias=\"configserver\" />\n" + "      <slobrok hostalias=\"logserver\" />\n" + "    </slobroks>\n" + "  </admin>\n" + "  <content version='1.0' id='bar'>" + "     <redundancy>1</redundancy>\n" + "     <documents>" + "       <document type=\"type1\" mode=\"store-only\"/>\n" + "     </documents>\n" + "     <group>" + "       <node hostalias='node0' distribution-key='0' />" + "     </group>" + "   </content>" + "\n" + "</services>";
    VespaModel model = createVespaModel(xml);
    assertTrue(model.getService("admin/cluster-controllers/0").isPresent());
    assertTrue(existsHostsWithClusterControllerConfigId(model));
    assertGroupSize(model, "admin/cluster-controllers/0/components/clustercontroller-bar-configurer", 1);
    assertThat(model.getAdmin().getClusterControllers().getContainers().size(), is(1));
    FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder();
    model.getConfig(builder, "admin/cluster-controllers/0/components/clustercontroller-bar-configurer");
    FleetcontrollerConfig cfg = new FleetcontrollerConfig(builder);
    assertThat(cfg.index(), is(0));
}
Also used : VespaModel(com.yahoo.vespa.model.VespaModel) FleetcontrollerConfig(com.yahoo.vespa.config.content.FleetcontrollerConfig) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 10 with FleetcontrollerConfig

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

the class ClusterControllerTestCase method testSingleCluster.

@Test
public void testSingleCluster() throws Exception {
    String xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + "<services>\n" + "\n" + "  <admin version=\"2.0\">\n" + "    <adminserver hostalias=\"configserver\" />\n" + "    <cluster-controllers>\n" + "      <cluster-controller hostalias=\"configserver\">" + "      </cluster-controller>" + "      <cluster-controller hostalias=\"configserver\"/>" + "      <cluster-controller hostalias=\"configserver\"/>" + "    </cluster-controllers>\n" + "  </admin>\n" + "  <content version='1.0' id='bar'>" + "     <redundancy>1</redundancy>\n" + "     <documents>" + "       <document type=\"type1\" mode=\"store-only\"/>\n" + "     </documents>\n" + "     <group>" + "       <node hostalias='node0' distribution-key='0' />" + "     </group>" + "    <tuning>" + "      <cluster-controller>\n" + "        <init-progress-time>34567s</init-progress-time>" + "        <transition-time>4000ms</transition-time>" + "        <stable-state-period>1h</stable-state-period>" + "      </cluster-controller>" + "    </tuning>" + "   </content>" + "\n" + "</services>";
    VespaModel model = createVespaModel(xml);
    assertTrue(model.getService("admin/cluster-controllers/0").isPresent());
    assertTrue(existsHostsWithClusterControllerConfigId(model));
    assertGroupSize(model, "admin/cluster-controllers/0/components/clustercontroller-bar-configurer", 1);
    for (int i = 0; i < 3; ++i) {
        FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder();
        model.getConfig(builder, "admin/cluster-controllers/" + i + "/components/clustercontroller-bar-configurer");
        FleetcontrollerConfig cfg = new FleetcontrollerConfig(builder);
        assertThat(cfg.index(), is(i));
        assertThat(cfg.fleet_controller_count(), is(3));
        assertThat(cfg.init_progress_time(), is(34567000));
        assertThat(cfg.storage_transition_time(), is(4000));
        assertThat(cfg.stable_state_time_period(), is(3600000));
    }
}
Also used : VespaModel(com.yahoo.vespa.model.VespaModel) FleetcontrollerConfig(com.yahoo.vespa.config.content.FleetcontrollerConfig) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Aggregations

FleetcontrollerConfig (com.yahoo.vespa.config.content.FleetcontrollerConfig)11 Test (org.junit.Test)9 VespaModel (com.yahoo.vespa.model.VespaModel)4 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)3 ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)2 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)2 SlobroksConfig (com.yahoo.cloud.config.SlobroksConfig)1 ZookeepersConfig (com.yahoo.cloud.config.ZookeepersConfig)1 Metric (com.yahoo.jdisc.Metric)1 StorDistributionConfig (com.yahoo.vespa.config.content.StorDistributionConfig)1 StorDistributormanagerConfig (com.yahoo.vespa.config.content.core.StorDistributormanagerConfig)1 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)1 Map (java.util.Map)1