public abstract class CommonArgs extends ArgOps implements SliderActions, Arguments
| Modifier and Type | Field and Description |
|---|---|
com.beust.jcommander.JCommander |
commander
fields
|
Map<String,String> |
definitionMap
-D name=value
Define an HBase configuration option which overrides any options in
the configuration XML files of the image or in the image configuration
directory.
|
boolean |
help |
protected static org.slf4j.Logger |
log |
Map<String,String> |
syspropsMap
System properties
|
ACTION_AM_SUICIDE, ACTION_BUILD, ACTION_CLIENT, ACTION_CREATE, ACTION_DEPENDENCY, ACTION_DESTROY, ACTION_DIAGNOSTICS, ACTION_ECHO, ACTION_EXISTS, ACTION_FLEX, ACTION_FREEZE, ACTION_HELP, ACTION_INSTALL_KEYTAB, ACTION_INSTALL_PACKAGE, ACTION_KDIAG, ACTION_KEYTAB, ACTION_KILL_CONTAINER, ACTION_LIST, ACTION_LOOKUP, ACTION_NODES, ACTION_PACKAGE, ACTION_PREFLIGHT, ACTION_RECONFIGURE, ACTION_REGISTRY, ACTION_RESOLVE, ACTION_STATUS, ACTION_THAW, ACTION_UPDATE, ACTION_UPGRADE, ACTION_VERSION, DESCRIBE_ACTION_AM_SUICIDE, DESCRIBE_ACTION_BUILD, DESCRIBE_ACTION_CLIENT, DESCRIBE_ACTION_CREATE, DESCRIBE_ACTION_DEPENDENCY, DESCRIBE_ACTION_DESTROY, DESCRIBE_ACTION_DIAGNOSTIC, DESCRIBE_ACTION_EXISTS, DESCRIBE_ACTION_FLEX, DESCRIBE_ACTION_FREEZE, DESCRIBE_ACTION_GETCONF, DESCRIBE_ACTION_HELP, DESCRIBE_ACTION_INSTALL_KEYTAB, DESCRIBE_ACTION_INSTALL_PACKAGE, DESCRIBE_ACTION_KDIAG, DESCRIBE_ACTION_KEYTAB, DESCRIBE_ACTION_KILL_CONTAINER, DESCRIBE_ACTION_LIST, DESCRIBE_ACTION_LOOKUP, DESCRIBE_ACTION_MONITOR, DESCRIBE_ACTION_NODES, DESCRIBE_ACTION_PACKAGE, DESCRIBE_ACTION_REGISTRY, DESCRIBE_ACTION_RESOLVE, DESCRIBE_ACTION_STATUS, DESCRIBE_ACTION_THAW, DESCRIBE_ACTION_UPDATE, DESCRIBE_ACTION_UPGRADE, DESCRIBE_ACTION_VERSIONARG_ADDON, ARG_ALIAS, ARG_ALL, ARG_APP_HOME, ARG_APPDEF, ARG_APPLICATION, ARG_BASE_PATH, ARG_CLIENT, ARG_CLUSTER_URI, ARG_COMP_OPT, ARG_COMP_OPT_SHORT, ARG_COMPONENT, ARG_COMPONENT_SHORT, ARG_COMPONENTS, ARG_CONFDIR, ARG_CONFIG, ARG_CONTAINERS, ARG_CREDENTIALS, ARG_DEBUG, ARG_DEFINE, ARG_DELETE, ARG_DEST, ARG_DESTDIR, ARG_DESTFILE, ARG_EXITCODE, ARG_FAIL, ARG_FILESYSTEM, ARG_FILESYSTEM_LONG, ARG_FOLDER, ARG_FORCE, ARG_FORMAT, ARG_GETCERTSTORE, ARG_GETCONF, ARG_GETEXP, ARG_GETFILES, ARG_HEALTHY, ARG_HELP, ARG_HOSTNAME, ARG_ID, ARG_IMAGE, ARG_INSTALL, ARG_INTERNAL, ARG_KEYSTORE, ARG_KEYTAB, ARG_KEYTABDELETE, ARG_KEYTABINSTALL, ARG_KEYTABLIST, ARG_LABEL, ARG_LEVEL, ARG_LIST, ARG_LISTCONF, ARG_LISTEXP, ARG_LISTFILES, ARG_LIVE, ARG_MANAGER, ARG_MANAGER_SHORT, ARG_MESSAGE, ARG_METAINFO, ARG_NAME, ARG_OPTION, ARG_OPTION_SHORT, ARG_OUTPUT, ARG_OUTPUT_SHORT, ARG_OVERWRITE, ARG_PACKAGE, ARG_PASSWORD, ARG_PATH, ARG_PKGDELETE, ARG_PKGINSTANCES, ARG_PKGLIST, ARG_PRINCIPAL, ARG_PROVIDER, ARG_QUEUE, ARG_REPLACE_PKG, ARG_RES_COMP_OPT, ARG_RES_COMP_OPT_SHORT, ARG_RESOURCE_MANAGER, ARG_RESOURCE_OPT, ARG_RESOURCE_OPT_SHORT, ARG_RESOURCES, ARG_RM_ADDR, ARG_ROLE, ARG_ROLEOPT, ARG_SERVICES, ARG_SERVICETYPE, ARG_SLIDER, ARG_STATE, ARG_SYSPROP, ARG_TEMPLATE, ARG_TRUSTSTORE, ARG_UPLOAD, ARG_USER, ARG_VERBOSE, ARG_VERSION, ARG_WAIT, ARG_YARN, ARG_ZKHOSTS, ARG_ZKPATH, ARG_ZKPORT| Modifier | Constructor and Description |
|---|---|
protected |
CommonArgs(Collection args) |
protected |
CommonArgs(String[] args) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAction(String name,
Object arg)
Add a command
|
protected void |
addActionArguments()
Override point to add a set of actions
|
protected void |
addActions(Object... actions) |
abstract void |
applyAction()
Implementors must implement their action apply routine here
|
void |
applyDefinitions(org.apache.hadoop.conf.Configuration conf)
Apply all the definitions on the command line to the configuration
|
void |
applyFileSystemBinding(org.apache.hadoop.conf.Configuration conf)
If the Filesystem binding was provided, it overrides anything in
the configuration
|
protected void |
bindCoreAction(AbstractActionArgs action)
Bind the core action; this extracts any attributes that are used
across routines
|
String |
getAction() |
List<String> |
getActionArgs() |
String[] |
getArgs() |
org.apache.hadoop.fs.Path |
getBasePath() |
String |
getClusterName()
get the name: relies on arg 1 being the cluster name in all operations
|
AbstractActionArgs |
getCoreAction()
Get the core action -type depends on the action
|
String |
getFilesystemBinding() |
String |
getManager() |
boolean |
isDebug() |
void |
parse()
Parse routine -includes registering the action-specific argument classes
and postprocess it
|
void |
postProcess()
validate args via
validate()
then postprocess the arguments |
String |
usage() |
static String |
usage(CommonArgs serviceArgs) |
static String |
usage(CommonArgs serviceArgs,
String commandOfInterest) |
void |
validate()
Validate the arguments against the action requested
|
applyDefinitions, applyFileSystemBinding, convertTripleListToMaps, convertTupleListToMap, splitPairs, tripleprotected static final org.slf4j.Logger log
public boolean help
public Map<String,String> definitionMap
public final com.beust.jcommander.JCommander commander
protected CommonArgs(String[] args)
protected CommonArgs(Collection args)
public String getClusterName()
public String usage()
public static String usage(CommonArgs serviceArgs, String commandOfInterest)
public static String usage(CommonArgs serviceArgs)
public void parse()
throws SliderException
SliderException - on any problemprotected void addAction(String name, Object arg)
name - actionarg - valueprotected void addActions(Object... actions)
protected void addActionArguments()
public void postProcess()
throws SliderException
validate()
then postprocess the argumentsSliderExceptionpublic abstract void applyAction()
throws SliderException
SliderExceptionprotected void bindCoreAction(AbstractActionArgs action)
action - action to bindpublic AbstractActionArgs getCoreAction()
public void validate()
throws BadCommandArgumentsException,
UsageException
public void applyDefinitions(org.apache.hadoop.conf.Configuration conf)
throws BadCommandArgumentsException
conf - configBadCommandArgumentsExceptionpublic void applyFileSystemBinding(org.apache.hadoop.conf.Configuration conf)
conf - configurationpublic boolean isDebug()
public String getFilesystemBinding()
public org.apache.hadoop.fs.Path getBasePath()
public String getManager()
public String getAction()
public String[] getArgs()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.