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));
}
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);
}
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);
}
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));
}
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));
}
}
Aggregations