org.apache.accumulo.cluster.standalone
public class StandaloneClusterControl extends Object implements ClusterControl
RemoteShell to control a standalone (possibly distibuted) Accumulo instance| Modifier and Type | Field and Description |
|---|---|
protected String |
accumuloConfDir |
protected String |
accumuloHome |
protected String |
accumuloPath |
protected RemoteShellOptions |
options |
protected String |
startServerPath |
protected String |
toolPath |
| Constructor and Description |
|---|
StandaloneClusterControl() |
StandaloneClusterControl(String accumuloHome,
String accumuloConfDir) |
| 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(ClusterServerType server,
String accumuloHome,
String hostname) |
protected String[] |
getPidCommand(ClusterServerType server,
String accumuloHome) |
protected String |
getProcessString(ClusterServerType server) |
void |
kill(ClusterServerType server,
String hostname)
Send SIGKILL to the given process on the host
|
void |
resume(ClusterServerType server,
String hostname)
Send SIGCONT to the given process on the host
|
void |
signal(ClusterServerType server,
String hostname,
String signal)
Send the provided signal to the process on the host
|
void |
start(ClusterServerType server,
String hostname)
Start the given process on the host
|
void |
startAllServers(ClusterServerType server)
Starts all occurrences of the given server
|
void |
stop(ClusterServerType server,
String hostname)
Stop the given process on the host
|
void |
stopAllServers(ClusterServerType server)
Stops all occurrences of the given server
|
void |
suspend(ClusterServerType server,
String hostname)
Send SIGSTOP to the given process on the host
|
protected String accumuloHome
protected String accumuloConfDir
protected RemoteShellOptions options
protected String startServerPath
protected String accumuloPath
protected String toolPath
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 startAllServers(ClusterServerType server) throws IOException
ClusterControlstartAllServers in interface ClusterControlIOExceptionpublic void start(ClusterServerType server, String hostname) throws IOException
ClusterControlstart in interface ClusterControlIOExceptionpublic void stopAllServers(ClusterServerType server) throws IOException
ClusterControlstopAllServers in interface ClusterControlIOExceptionpublic void stop(ClusterServerType server, String hostname) throws IOException
ClusterControlstop in interface ClusterControlIOExceptionpublic void signal(ClusterServerType server, String hostname, String signal) throws IOException
ClusterControlsignal in interface ClusterControlIOExceptionpublic void suspend(ClusterServerType server, String hostname) throws IOException
ClusterControlsuspend in interface ClusterControlIOExceptionpublic void resume(ClusterServerType server, String hostname) throws IOException
ClusterControlresume in interface ClusterControlIOExceptionpublic void kill(ClusterServerType server, String hostname) throws IOException
ClusterControlkill in interface ClusterControlIOExceptionprotected String getPid(ClusterServerType server, String accumuloHome, String hostname) throws IOException
IOExceptionprotected String[] getPidCommand(ClusterServerType server, String accumuloHome)
protected String getProcessString(ClusterServerType server)
protected File getConfDir()
protected List<String> getHosts(File f) throws IOException
IOExceptionCopyright © 2011–2016 The Apache Software Foundation. All rights reserved.