public abstract class AbstractClusterCommand extends Command
| Modifier and Type | Field and Description |
|---|---|
protected ClusterControllerFactory |
factory |
protected joptsimple.OptionParser |
parser |
protected ClusterStateStoreFactory |
stateStoreFactory |
| Constructor and Description |
|---|
AbstractClusterCommand(String name,
String description,
ClusterControllerFactory factory) |
AbstractClusterCommand(String name,
String description,
ClusterControllerFactory factory,
ClusterStateStoreFactory stateStoreFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected ClusterController |
createClusterController(String serviceName)
Create the specified service
|
protected ClusterStateStore |
createClusterStateStore(ClusterSpec spec)
Create the cluster state store object
|
protected Cluster |
getCluster(ClusterSpec clusterSpec,
ClusterController controller)
Get the cluster instance together with NodeMetadata (through API calls)
|
protected ClusterSpec |
getClusterSpec(joptsimple.OptionSet optionSet)
Load the cluster spec by parsing the command line option set
|
protected void |
printErrorAndHelpHint(PrintStream stream,
Throwable e)
Print command execution error and a hint to help the user get more help
|
protected void |
printProviderInfo(PrintStream out,
PrintStream err,
ClusterSpec clusterSpec,
joptsimple.OptionSet optionSet) |
void |
printUsage(PrintStream stream)
Print a generic usage indication for commands
|
getDescription, getName, runprotected ClusterControllerFactory factory
protected ClusterStateStoreFactory stateStoreFactory
protected joptsimple.OptionParser parser
public AbstractClusterCommand(String name, String description, ClusterControllerFactory factory)
public AbstractClusterCommand(String name, String description, ClusterControllerFactory factory, ClusterStateStoreFactory stateStoreFactory)
protected ClusterSpec getClusterSpec(joptsimple.OptionSet optionSet) throws org.apache.commons.configuration.ConfigurationException
org.apache.commons.configuration.ConfigurationExceptionprotected Cluster getCluster(ClusterSpec clusterSpec, ClusterController controller) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected ClusterController createClusterController(String serviceName)
protected ClusterStateStore createClusterStateStore(ClusterSpec spec)
protected void printProviderInfo(PrintStream out, PrintStream err, ClusterSpec clusterSpec, joptsimple.OptionSet optionSet)
protected void printErrorAndHelpHint(PrintStream stream, Throwable e)
public void printUsage(PrintStream stream) throws IOException
printUsage in class CommandIOExceptionCopyright © 2010–2016 Cloudera. All rights reserved.