diff options
author | Harald Musum <musum@yahoo-inc.com> | 2017-02-08 08:03:50 +0100 |
---|---|---|
committer | Harald Musum <musum@yahoo-inc.com> | 2017-02-08 08:03:50 +0100 |
commit | ac1b06d524505175d2606c5683b24b6206d518a1 (patch) | |
tree | 7bf960d47056a88eafc9cfc32ac93adab50ae296 /node-admin | |
parent | 3865a64aa7dd94482a0c5c1e38f23edfe591d8ed (diff) |
Use 'restart-vespa' command, 'restart' is deprecated
Diffstat (limited to 'node-admin')
4 files changed, 8 insertions, 8 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperations.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperations.java index 3f9f0686d82..3c3aeb5bba8 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperations.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperations.java @@ -32,7 +32,7 @@ public interface DockerOperations { void resumeNode(ContainerName containerName); - void restartServicesOnNode(ContainerName containerName); + void restartVespaOnNode(ContainerName containerName); void stopServicesOnNode(ContainerName containerName); diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java index 971fe235f70..cf81f16862b 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/docker/DockerOperationsImpl.java @@ -46,14 +46,14 @@ public class DockerOperationsImpl implements DockerOperations { private static final String[] RESUME_NODE_COMMAND = new String[] {NODE_PROGRAM, "resume"}; private static final String[] SUSPEND_NODE_COMMAND = new String[] {NODE_PROGRAM, "suspend"}; - private static final String[] RESTART_NODE_COMMAND = new String[] {NODE_PROGRAM, "restart"}; + private static final String[] RESTART_VESPA_ON_NODE_COMMAND = new String[] {NODE_PROGRAM, "restart-vespa"}; private static final String[] STOP_NODE_COMMAND = new String[] {NODE_PROGRAM, "stop"}; private static final Pattern VESPA_VERSION_PATTERN = Pattern.compile("^(\\S*)$", Pattern.MULTILINE); private static final String MANAGER_NAME = "node-admin"; - // Map of directories to mount and whether they should be writeable by everyone + // Map of directories to mount and whether they should be writable by everyone private static final Map<String, Boolean> DIRECTORIES_TO_MOUNT = new HashMap<>(); static { DIRECTORIES_TO_MOUNT.put("/etc/yamas-agent", true); @@ -192,7 +192,7 @@ public class DockerOperationsImpl implements DockerOperations { } // TODO: Enforce disk constraints - // TODO: Consider if CPU shares or quoata should be set. For now we are just assuming they are + // TODO: Consider if CPU shares or quota should be set. For now we are just assuming they are // nicely controlled by docker. if (nodeSpec.minMainMemoryAvailableGb.isPresent()) { long minMainMemoryAvailableMb = (long) (nodeSpec.minMainMemoryAvailableGb.get() * 1024); @@ -310,8 +310,8 @@ public class DockerOperationsImpl implements DockerOperations { } @Override - public void restartServicesOnNode(ContainerName containerName) { - executeCommandInContainer(containerName, RESTART_NODE_COMMAND); + public void restartVespaOnNode(ContainerName containerName) { + executeCommandInContainer(containerName, RESTART_VESPA_ON_NODE_COMMAND); } @Override diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java index c839863cb69..4c1e400b9bc 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java @@ -285,7 +285,7 @@ public class NodeAgentImpl implements NodeAgent { logger.info("Restarting services for " + containerName); // Since we are restarting the services we need to suspend the node. orchestratorSuspendNode(orchestrator, nodeSpec, logger); - dockerOperations.restartServicesOnNode(containerName); + dockerOperations.restartVespaOnNode(containerName); } } } diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java index 9c2adca3bb7..c945f2d84f6 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/integrationTests/RestartTest.java @@ -40,7 +40,7 @@ public class RestartTest { dockerTester.updateContainerNodeSpec(createContainerNodeSpec(wantedRestartGeneration, currentRestartGeneration)); callOrderVerifier.assertInOrder("Suspend for host1", - "executeInContainerAsRoot with ContainerName { name=container }, args: [" + DockerOperationsImpl.NODE_PROGRAM + ", restart]"); + "executeInContainerAsRoot with ContainerName { name=container }, args: [" + DockerOperationsImpl.NODE_PROGRAM + ", restart-vespa]"); } } |