diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-04-05 19:35:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-05 19:35:49 +0200 |
commit | c84ed73f53884f74dfedaf6d62a448b7a0dd8a17 (patch) | |
tree | 4b18419be99ea426c72e7905ec11f0feb722c6b5 /config-model | |
parent | 6f968e2e3ff884f9087e770a15b8b17f7f4c77ee (diff) |
Revert "Revert "Balder/quick restart of slobrok""
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/admin/Slobrok.java | 18 | ||||
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java | 8 |
2 files changed, 19 insertions, 7 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/Slobrok.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/Slobrok.java index 093694f41b3..aa6192291d3 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/Slobrok.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/Slobrok.java @@ -2,6 +2,7 @@ package com.yahoo.vespa.model.admin; import com.yahoo.config.model.producer.AbstractConfigProducer; +import com.yahoo.vespa.config.StateserverConfig; import com.yahoo.vespa.model.AbstractService; /** @@ -9,9 +10,14 @@ import com.yahoo.vespa.model.AbstractService; * * @author gjoranv */ -public class Slobrok extends AbstractService { +public class Slobrok extends AbstractService implements StateserverConfig.Producer { private static final long serialVersionUID = 1L; + @Override + public void getConfig(StateserverConfig.Builder builder) { + builder.httpport(getStatePort()); + } + /** * @param parent The parent ConfigProducer. * @param index unique index for all slobroks @@ -40,9 +46,7 @@ public class Slobrok extends AbstractService { } public String getStartupCommand() { - return "exec $ROOT/sbin/vespa-slobrok -p " + getPort() + - " -s " + getStatePort() + - " -c " + getConfigId(); + return "exec $ROOT/sbin/vespa-slobrok -p " + getPort() + " -c " + getConfigId(); } /** @@ -55,15 +59,15 @@ public class Slobrok extends AbstractService { /** * @return The port on which this slobrok should respond, as a String. */ - public String getPort() { + private String getPort() { return String.valueOf(getRelativePort(0)); } /** * @return The port on which the state server should respond */ - public String getStatePort() { - return String.valueOf(getRelativePort(1)); + public int getStatePort() { + return getRelativePort(1); } /** diff --git a/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java index 5e6241a7043..a88d3b388a9 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java @@ -17,6 +17,7 @@ import com.yahoo.config.provision.Zone; import com.yahoo.container.StatisticsConfig; import com.yahoo.container.jdisc.config.HealthMonitorConfig; import com.yahoo.net.HostName; +import com.yahoo.vespa.config.StateserverConfig; import com.yahoo.vespa.model.VespaModel; import com.yahoo.vespa.model.container.ContainerCluster; import com.yahoo.vespa.model.container.component.Component; @@ -83,6 +84,13 @@ public class AdminTestCase { } assertTrue(localHostOK); + StateserverConfig.Builder ssb = new StateserverConfig.Builder(); + vespaModel.getConfig(ssb, "admin/slobrok.0"); + assertEquals(19100, new StateserverConfig(ssb).httpport()); + + vespaModel.getConfig(ssb, "admin/slobrok.1"); + assertEquals(19102, new StateserverConfig(ssb).httpport()); + LogdConfig.Builder lb = new LogdConfig.Builder(); vespaModel.getConfig(lb, "admin/slobrok.0"); LogdConfig lc = new LogdConfig(lb); |