public class SingleNodeRuntimeEngine extends RuntimeEngine
deployment, networkManager, nodeWorkspaceMap, stopped
Constructor and Description |
---|
SingleNodeRuntimeEngine(Deployment deployment,
Map<String,NodeWorkspace> nodeWorkspaceMap) |
Modifier and Type | Method and Description |
---|---|
void |
clockDrift(String nodeName,
Integer amount)
Applies a clock drift with the given amount on the given node name
|
protected String |
getEventServerIpAddress()
This method should find the best IP address for the nodes to connect to the event server based on the current environment
|
protected Map<String,String> |
improveEnvironmentVariablesMapForEngine(String nodeName,
Map<String,String> environment)
This method improves a node's env var map
|
String |
ip(String nodeName) |
void |
killNode(String nodeName)
Kills a node in the deployed environment.
|
Integer |
portMapping(String nodeName,
Integer portNumber,
PortType portType)
Returns the port mapping for a udp/tcp port number in a specific node
|
void |
restartNode(String nodeName,
Integer secondsUntilForcedStop)
Restarts a node in the deployed environment.
|
CommandResults |
runCommandInNode(String nodeName,
String command)
Executes a shell command in the given node
|
protected void |
startFileSharingService()
This method should start the file sharing service (if any), create the defined shared directory in the deployment definition
if they do not exist, and make them available through the sharing service.
|
void |
startNode(String nodeName)
Starts a node in the deployed environment.
|
protected void |
startNodes()
This method should start all of the nodes.
|
protected void |
stopFileSharingService()
This method should stop the potentially running file sharing server and unmount shared directories in the nodes (if necessary).
|
void |
stopNode(String nodeName,
Integer secondsUntilForcedStop)
Stops a node in the deployed environment.
|
protected void |
stopNodes(Boolean kill,
Integer secondsUntilForcedStop)
This method should stop all of the nodes and in case of a failure in stopping something it won't throw any exception, but
error logs the exception or a message.
|
enforceOrder, enforceOrder, getNodeEnvironmentVariablesMap, getNodeEnvironmentVariablesMap, getNodeExposedPorts, getNodeInitCommand, getNodeStartCommand, getNodeStopCommand, getRuntimeEngine, improveEnvironmentVariablesMap, isStopped, networkPartition, nodeNames, removeNetworkPartition, start, startEventServer, stop, stopEventServer, waitFor, waitFor, waitFor, waitFor
public SingleNodeRuntimeEngine(Deployment deployment, Map<String,NodeWorkspace> nodeWorkspaceMap)
public String ip(String nodeName)
nodeName
- the node name to find ip address forpublic Integer portMapping(String nodeName, Integer portNumber, PortType portType)
LimitedRuntimeEngine
nodeName
- the node nameportNumber
- the source port numberportType
- tcp or udpprotected void startNodes() throws RuntimeEngineException
RuntimeEngine
startNodes
in class RuntimeEngine
RuntimeEngineException
public CommandResults runCommandInNode(String nodeName, String command) throws RuntimeEngineException
LimitedRuntimeEngine
nodeName
- the node name to execute the shell command intocommand
- the command to be executedRuntimeEngineException
- if something goes wrongNodeIsNotRunningException
- if the node is not runningNodeNotFoundException
- if the node doesn't existprotected Map<String,String> improveEnvironmentVariablesMapForEngine(String nodeName, Map<String,String> environment) throws RuntimeEngineException
RuntimeEngine
improveEnvironmentVariablesMapForEngine
in class RuntimeEngine
nodeName
- the corresponding node to be improvedenvironment
- the current environment of the nodeRuntimeEngineException
- if something goes wrongprotected String getEventServerIpAddress() throws RuntimeEngineException
RuntimeEngine
getEventServerIpAddress
in class RuntimeEngine
RuntimeEngineException
- if something goes wrongprotected void stopNodes(Boolean kill, Integer secondsUntilForcedStop)
RuntimeEngine
stopNodes
in class RuntimeEngine
public void killNode(String nodeName) throws RuntimeEngineException
LimitedRuntimeEngine
nodeName
- the node name to be killedRuntimeEngineException
- is something goes wrongNodeNotFoundException
- if the node doesn't existpublic void stopNode(String nodeName, Integer secondsUntilForcedStop) throws RuntimeEngineException
LimitedRuntimeEngine
nodeName
- the node name to be StoppedsecondsUntilForcedStop
- the number of seconds to wait until forcing a stopRuntimeEngineException
- is something goes wrongNodeNotFoundException
- if the node doesn't existpublic void startNode(String nodeName) throws RuntimeEngineException
LimitedRuntimeEngine
nodeName
- the node name to be startedRuntimeEngineException
- is something goes wrongNodeNotFoundException
- if the node doesn't existpublic void restartNode(String nodeName, Integer secondsUntilForcedStop) throws RuntimeEngineException
LimitedRuntimeEngine
nodeName
- the node name to be restartedsecondsUntilForcedStop
- the number of seconds to wait until forcing a stopRuntimeEngineException
- is something goes wrongNodeNotFoundException
- if the node doesn't existpublic void clockDrift(String nodeName, Integer amount) throws RuntimeEngineException
LimitedRuntimeEngine
nodeName
- the node name to apply the clock drift onamount
- the positive or negative amount of time offset to apply in millisecondsRuntimeEngineException
- is something goes wrongNodeNotFoundException
- if the node doesn't existprotected void startFileSharingService()
RuntimeEngine
startFileSharingService
in class RuntimeEngine
protected void stopFileSharingService()
RuntimeEngine
stopFileSharingService
in class RuntimeEngine
Copyright © 2019. All rights reserved.