use of com.yahoo.config.model.producer.AbstractConfigProducerRoot in project vespa by vespa-engine.
the class ClusterControllerConfig method getConfig.
@Override
public void getConfig(FleetcontrollerConfig.Builder builder) {
AbstractConfigProducerRoot root = getRoot();
if (root instanceof VespaModel) {
String zooKeeperAddress = root.getAdmin().getZooKeepersConfigProvider().getZooKeepersConnectionSpec();
builder.zookeeper_server(zooKeeperAddress);
} else {
builder.zookeeper_server("");
}
builder.index(0);
builder.cluster_name(clusterName);
builder.fleet_controller_count(getChildren().size());
if (initProgressTime != null) {
builder.init_progress_time((int) initProgressTime.getMilliSeconds());
}
if (transitionTime != null) {
builder.storage_transition_time((int) transitionTime.getMilliSeconds());
}
if (maxPrematureCrashes != null) {
builder.max_premature_crashes(maxPrematureCrashes.intValue());
}
if (stableStateTimePeriod != null) {
builder.stable_state_time_period((int) stableStateTimePeriod.getMilliSeconds());
}
if (minDistributorUpRatio != null) {
builder.min_distributor_up_ratio(minDistributorUpRatio);
}
if (minStorageUpRatio != null) {
builder.min_storage_up_ratio(minStorageUpRatio);
}
if (minSplitBits != null) {
builder.ideal_distribution_bits(minSplitBits);
}
if (minNodeRatioPerGroup != null) {
builder.min_node_ratio_per_group(minNodeRatioPerGroup);
}
}
use of com.yahoo.config.model.producer.AbstractConfigProducerRoot in project vespa by vespa-engine.
the class ContainerModelBuilderTest method vip_status_handler_uses_file_for_hosted_vespa.
@Test
public void vip_status_handler_uses_file_for_hosted_vespa() throws Exception {
String servicesXml = "<services>" + "<jdisc version='1.0'>" + nodesXml + "</jdisc>" + "</services>";
ApplicationPackage applicationPackage = new MockApplicationPackage.Builder().withServices(servicesXml).build();
VespaModel model = new VespaModel(new NullConfigModelRegistry(), new DeployState.Builder().applicationPackage(applicationPackage).properties(new DeployProperties.Builder().hostedVespa(true).build()).build(true));
AbstractConfigProducerRoot modelRoot = model.getRoot();
VipStatusConfig vipStatusConfig = modelRoot.getConfig(VipStatusConfig.class, "jdisc/component/status.html-status-handler");
assertTrue(vipStatusConfig.accessdisk());
assertEquals(ContainerModelBuilder.HOSTED_VESPA_STATUS_FILE, vipStatusConfig.statusfile());
}
Aggregations