public class StandaloneClusterControl extends Object implements ClusterControl
RemoteShell to control a standalone (possibly distibuted) Accumulo instance| Modifier and Type | Field and Description |
|---|---|
protected String |
accumuloHome |
protected String |
accumuloPath |
protected String |
clientAccumuloConfDir |
protected RemoteShellOptions |
options |
protected String |
serverAccumuloConfDir |
protected String |
startServerPath |
protected String |
toolPath |
protected String |
user |
| Constructor and Description |
|---|
StandaloneClusterControl(String user) |
StandaloneClusterControl(String user,
String accumuloHome,
String clientAccumuloConfDir,
String serverAccumuloConfDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
adminStopAll()
Issue an orderly shutdown of the cluster, throws an exception if it fails to return
successfully (return value of 0).
|
int |
exec(Class<?> clz,
String[] args)
Execute the given class against the cluster with the provided arguments and waits for
completion.
|
protected Map.Entry<Integer,String> |
exec(String hostname,
String[] command) |
Map.Entry<Integer,String> |
execMapreduceWithStdout(Class<?> clz,
String[] args) |
Map.Entry<Integer,String> |
execWithStdout(Class<?> clz,
String[] args)
Execute the given class against the cluster with the provided arguments and waits for
completion.
|
protected File |
getConfDir() |
protected List<String> |
getHosts(File f)
Read the provided file and return all lines which don't start with a '#' character
|
protected String |
getPid(ServerType server,
String accumuloHome,
String hostname) |
protected String[] |
getPidCommand(ServerType server,
String accumuloHome) |
protected String |
getProcessString(ServerType server) |
void |
kill(ServerType server,
String hostname)
Send SIGKILL to the given process on the host
|
void |
resume(ServerType server,
String hostname)
Send SIGCONT to the given process on the host
|
void |
setGoalState(String goalState)
Wrapper around SetGoalState using the "server"
ACCUMULO_CONF_DIR |
void |
signal(ServerType server,
String hostname,
String signal)
Send the provided signal to the process on the host
|
void |
start(ServerType server,
String hostname)
Start the given process on the host
|
void |
startAllServers(ServerType server)
Starts all occurrences of the given server
|
void |
stop(ServerType server,
String hostname)
Stop the given process on the host
|
void |
stopAllServers(ServerType server)
Stops all occurrences of the given server
|
void |
suspend(ServerType server,
String hostname)
Send SIGSTOP to the given process on the host
|
protected String user
protected String accumuloHome
protected String clientAccumuloConfDir
protected String serverAccumuloConfDir
protected RemoteShellOptions options
protected String startServerPath
protected String accumuloPath
protected String toolPath
public StandaloneClusterControl(String user)
protected Map.Entry<Integer,String> exec(String hostname, String[] command) throws IOException
IOExceptionpublic int exec(Class<?> clz, String[] args) throws IOException
ClusterControlexec in interface ClusterControlIOExceptionpublic Map.Entry<Integer,String> execWithStdout(Class<?> clz, String[] args) throws IOException
ClusterControlexecWithStdout in interface ClusterControlIOExceptionpublic Map.Entry<Integer,String> execMapreduceWithStdout(Class<?> clz, String[] args) throws IOException
IOExceptionpublic void adminStopAll()
throws IOException
ClusterControladminStopAll in interface ClusterControlIOExceptionpublic void setGoalState(String goalState) throws IOException
ACCUMULO_CONF_DIRgoalState - The goal state to setIOException - If SetGoalState returns a non-zero resultpublic void startAllServers(ServerType server) throws IOException
ClusterControlstartAllServers in interface ClusterControlIOExceptionpublic void start(ServerType server, String hostname) throws IOException
ClusterControlstart in interface ClusterControlIOExceptionpublic void stopAllServers(ServerType server) throws IOException
ClusterControlstopAllServers in interface ClusterControlIOExceptionpublic void stop(ServerType server, String hostname) throws IOException
ClusterControlstop in interface ClusterControlIOExceptionpublic void signal(ServerType server, String hostname, String signal) throws IOException
ClusterControlsignal in interface ClusterControlIOExceptionpublic void suspend(ServerType server, String hostname) throws IOException
ClusterControlsuspend in interface ClusterControlIOExceptionpublic void resume(ServerType server, String hostname) throws IOException
ClusterControlresume in interface ClusterControlIOExceptionpublic void kill(ServerType server, String hostname) throws IOException
ClusterControlkill in interface ClusterControlIOExceptionprotected String getPid(ServerType server, String accumuloHome, String hostname) throws IOException
IOExceptionprotected String[] getPidCommand(ServerType server, String accumuloHome)
protected String getProcessString(ServerType server)
protected File getConfDir()
protected List<String> getHosts(File f) throws IOException
IOExceptionCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.