diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2019-03-14 19:15:09 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2019-03-14 19:15:09 +0000 |
commit | 33bb16aa777b63646f7577be48d6b7994eb880de (patch) | |
tree | d41f2701119d0431a79e84ea1e5887bebf126476 /config-model | |
parent | ff201447a3e3d1ef22232742c99ea0aa7ab72718 (diff) |
stop modeling autostart / autorestart
* these flags are always true, so no need to configure them
Diffstat (limited to 'config-model')
7 files changed, 8 insertions, 70 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java b/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java index 02bb0b412d1..cb3308d75bf 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java @@ -251,28 +251,6 @@ public abstract class AbstractService extends AbstractConfigProducer<AbstractCon } /** - * Tells if this service should be autostarted by - * config-sentinel. Returned value will be used to configure the - * config-sentinel. - * - * @return true by default. - */ - public boolean getAutostartFlag() { - return true; - } - - /** - * Tells if this service should be autorestarted by - * config-sentinel. Returned value will be used to configure the - * config-sentinel. - * - * @return true by default. - */ - public boolean getAutorestartFlag() { - return true; - } - - /** * Returns the name that identifies this service for the config-sentinel. * * @return the name that identifies this service for the config-sentinel. diff --git a/config-model/src/main/java/com/yahoo/vespa/model/ConfigProxy.java b/config-model/src/main/java/com/yahoo/vespa/model/ConfigProxy.java index 7ab28faa434..4fe13c8bede 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/ConfigProxy.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/ConfigProxy.java @@ -52,14 +52,4 @@ public class ConfigProxy extends AbstractService { return new String[]{"rpc"}; } - /** - * The config proxy is not started by the config system! - */ - public boolean getAutostartFlag() { return false; } - - /** - * The config proxy is not started by the config system! - */ - public boolean getAutorestartFlag() { return false; } - } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/ConfigSentinel.java b/config-model/src/main/java/com/yahoo/vespa/model/ConfigSentinel.java index 1b5c5e4a579..3f1202ccfd7 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/ConfigSentinel.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/ConfigSentinel.java @@ -87,8 +87,6 @@ public class ConfigSentinel extends AbstractService implements SentinelConfig.Pr SentinelConfig.Service.Builder serviceBuilder = new SentinelConfig.Service.Builder(); serviceBuilder.command(s.getStartupCommand()); serviceBuilder.name(s.getServiceName()); - serviceBuilder.autostart(s.getAutostartFlag()); - serviceBuilder.autorestart(s.getAutorestartFlag()); serviceBuilder.id(s.getConfigId()); serviceBuilder.affinity(getServiceAffinity(s)); setPreShutdownCommand(serviceBuilder, s); diff --git a/config-model/src/main/java/com/yahoo/vespa/model/Service.java b/config-model/src/main/java/com/yahoo/vespa/model/Service.java index 0af4355764c..7958718af11 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/Service.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/Service.java @@ -30,20 +30,6 @@ public interface Service extends ConfigProducer, NetworkPortRequestor { Optional<String> getPreShutdownCommand(); /** - * Tells if this service should be autostarted by - * config-sentinel. Returned value will be used to configure the - * config-sentinel. - */ - boolean getAutostartFlag(); - - /** - * Tells if this service should be autorestarted by - * config-sentinel. Returned value will be used to configure the - * config-sentinel. - */ - boolean getAutorestartFlag(); - - /** * Returns a PortsMeta object, giving access to more information * about the different ports of this service. */ diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/Configserver.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/Configserver.java index 2645b6cd59d..e8ca03b277d 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/Configserver.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/Configserver.java @@ -55,16 +55,6 @@ public class Configserver extends AbstractService { return new String[]{ "rpc", "http" }; } - /** - * The configserver is not started by the config system! - */ - public boolean getAutostartFlag() { return false; } - - /** - * The configserver is not started by the config system! - */ - public boolean getAutorestartFlag() { return false; } - private int getConfigServerRpcPort() { return getRelativePort(0); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/generic/GenericServicesTest.java b/config-model/src/test/java/com/yahoo/vespa/model/generic/GenericServicesTest.java index d83e10864cf..c6c08df64f4 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/generic/GenericServicesTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/generic/GenericServicesTest.java @@ -50,21 +50,20 @@ public class GenericServicesTest { SentinelConfig sentinel3 = model.getConfig(SentinelConfig.class, sentinelConfigId3); SentinelConfig sentinel4 = model.getConfig(SentinelConfig.class, sentinelConfigId4); - assertServiceExists(sentinel1, "myservice", "mycmd1.sh", "myservice/0", true, true); - assertServiceExists(sentinel2, "myservice", "mycmd1.sh", "myservice/1", true, true); - assertServiceExists(sentinel3, "myservice", "mycmd1.sh", "myservice/2", true, true); - assertServiceExists(sentinel3, "myservice2", "mycmd1.sh", "myservice/3", true, true); - assertServiceExists(sentinel3, "myotherservice", "/home/vespa/bin/mycmd2.sh --ytest $FOO_BAR", "myotherservice/0", true, true); - assertServiceExists(sentinel4, "myotherservice", "/home/vespa/bin/mycmd2.sh --ytest $FOO_BAR", "myotherservice/1", true, true); + assertServiceExists(sentinel1, "myservice", "mycmd1.sh", "myservice/0"); + assertServiceExists(sentinel2, "myservice", "mycmd1.sh", "myservice/1"); + assertServiceExists(sentinel3, "myservice", "mycmd1.sh", "myservice/2"); + assertServiceExists(sentinel3, "myservice2", "mycmd1.sh", "myservice/3"); + assertServiceExists(sentinel3, "myotherservice", "/home/vespa/bin/mycmd2.sh --ytest $FOO_BAR", "myotherservice/0"); + assertServiceExists(sentinel4, "myotherservice", "/home/vespa/bin/mycmd2.sh --ytest $FOO_BAR", "myotherservice/1"); } - private void assertServiceExists(SentinelConfig sentinel, String serviceName, String cmd, String configId, boolean autostart, boolean autorestart) { + private void assertServiceExists(SentinelConfig sentinel, String serviceName, String cmd, String configId) { boolean matches = false; Iterator<SentinelConfig.Service> it = sentinel.service().iterator(); while (!matches && it.hasNext()) { SentinelConfig.Service service = it.next(); - matches = service.autorestart() == autorestart && - service.autostart() == autostart && + matches = service.name().equals(serviceName) && service.id().equals(configId) && service.command().equals(cmd); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/test/SimpleService.java b/config-model/src/test/java/com/yahoo/vespa/model/test/SimpleService.java index a38916463c4..8a5bbe36a73 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/test/SimpleService.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/test/SimpleService.java @@ -46,9 +46,6 @@ public class SimpleService extends AbstractService implements com.yahoo.test.Sta // Make sure this service is listed in the sentinel config public String getStartupCommand() { return "sleep 0"; } - public boolean getAutostartFlag() { return false; } - public boolean getAutorestartFlag() { return false; } - @Override public HashMap<String,String> getDefaultMetricDimensions(){ HashMap<String, String> dimensions = new HashMap<>(); |