org.apache.oozie.cli
Class OozieCLI

java.lang.Object
  extended by org.apache.oozie.cli.OozieCLI

public class OozieCLI
extends Object

Oozie command line utility.


Field Summary
static String ACTION_OPTION
           
static String ADMIN_CMD
           
static String CHANGE_OPTION
           
static String CHANGE_VALUE_OPTION
           
static String CONFIG_CONTENT_OPTION
           
static String CONFIG_OPTION
           
static String DATE_OPTION
           
static String DEFINITION_OPTION
           
static String DRYRUN_OPTION
           
static String ENV_OOZIE_DEBUG
           
static String ENV_OOZIE_URL
           
static String FILTER_OPTION
           
static String HELP_CMD
           
static String INFO_OPTION
           
static String JOB_CMD
           
static String JOBS_CMD
           
static String JOBTYPE_OPTION
           
static String KILL_OPTION
           
static String LEN_OPTION
           
static String LOCAL_TIME_OPTION
           
static String LOG_OPTION
           
static String OFFSET_OPTION
           
static String OOZIE_OPTION
           
static String PIG_CMD
           
static String PIGFILE_OPTION
           
static String QUEUE_DUMP_OPTION
           
static String RERUN_COORD_OPTION
           
static String RERUN_NOCLEANUP_OPTION
           
static String RERUN_OPTION
           
static String RERUN_REFRESH_OPTION
           
static String RESUME_OPTION
           
static String RUN_OPTION
           
static String SLA_CMD
           
static String START_OPTION
           
static String STATUS_OPTION
           
static String SUBMIT_OPTION
           
static String SUSPEND_OPTION
           
static String SYSTEM_MODE_OPTION
           
static String VALIDATE_CMD
           
static String VERBOSE_DELIMITER
           
static String VERBOSE_OPTION
           
static String VERSION_CMD
           
static String VERSION_OPTION
           
static String WS_HEADER_PREFIX
           
 
Constructor Summary
OozieCLI()
          Create an Oozie CLI instance.
 
Method Summary
protected  org.apache.commons.cli.Options createAdminOptions()
           
protected  org.apache.commons.cli.Options createJobOptions()
           
protected  org.apache.commons.cli.Options createJobsOptions()
           
protected  OozieClient createOozieClient(org.apache.commons.cli.CommandLine commandLine)
          Create a OozieClient.
protected  org.apache.commons.cli.Options createPigOptions()
           
protected  org.apache.commons.cli.Options createSlaOptions()
           
protected  XOozieClient createXOozieClient(org.apache.commons.cli.CommandLine commandLine)
          Create a XOozieClient.
protected  String[] getCLIHelp()
          Return Oozie CLI top help lines.
protected  String getOozieUrl(org.apache.commons.cli.CommandLine commandLine)
           
static void main(String[] args)
          Entry point for the Oozie CLI when invoked from the command line.
 int run(String[] args)
          Run a CLI programmatically.
protected  void setDebugMode(OozieClient wc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENV_OOZIE_URL

public static final String ENV_OOZIE_URL
See Also:
Constant Field Values

ENV_OOZIE_DEBUG

public static final String ENV_OOZIE_DEBUG
See Also:
Constant Field Values

WS_HEADER_PREFIX

public static final String WS_HEADER_PREFIX
See Also:
Constant Field Values

HELP_CMD

public static final String HELP_CMD
See Also:
Constant Field Values

VERSION_CMD

public static final String VERSION_CMD
See Also:
Constant Field Values

JOB_CMD

public static final String JOB_CMD
See Also:
Constant Field Values

JOBS_CMD

public static final String JOBS_CMD
See Also:
Constant Field Values

ADMIN_CMD

public static final String ADMIN_CMD
See Also:
Constant Field Values

VALIDATE_CMD

public static final String VALIDATE_CMD
See Also:
Constant Field Values

SLA_CMD

public static final String SLA_CMD
See Also:
Constant Field Values

PIG_CMD

public static final String PIG_CMD
See Also:
Constant Field Values

OOZIE_OPTION

public static final String OOZIE_OPTION
See Also:
Constant Field Values

CONFIG_OPTION

public static final String CONFIG_OPTION
See Also:
Constant Field Values

SUBMIT_OPTION

public static final String SUBMIT_OPTION
See Also:
Constant Field Values

OFFSET_OPTION

public static final String OFFSET_OPTION
See Also:
Constant Field Values

START_OPTION

public static final String START_OPTION
See Also:
Constant Field Values

RUN_OPTION

public static final String RUN_OPTION
See Also:
Constant Field Values

DRYRUN_OPTION

public static final String DRYRUN_OPTION
See Also:
Constant Field Values

SUSPEND_OPTION

public static final String SUSPEND_OPTION
See Also:
Constant Field Values

RESUME_OPTION

public static final String RESUME_OPTION
See Also:
Constant Field Values

KILL_OPTION

public static final String KILL_OPTION
See Also:
Constant Field Values

CHANGE_OPTION

public static final String CHANGE_OPTION
See Also:
Constant Field Values

CHANGE_VALUE_OPTION

public static final String CHANGE_VALUE_OPTION
See Also:
Constant Field Values

RERUN_OPTION

public static final String RERUN_OPTION
See Also:
Constant Field Values

INFO_OPTION

public static final String INFO_OPTION
See Also:
Constant Field Values

LOG_OPTION

public static final String LOG_OPTION
See Also:
Constant Field Values

ACTION_OPTION

public static final String ACTION_OPTION
See Also:
Constant Field Values

DEFINITION_OPTION

public static final String DEFINITION_OPTION
See Also:
Constant Field Values

CONFIG_CONTENT_OPTION

public static final String CONFIG_CONTENT_OPTION
See Also:
Constant Field Values

LEN_OPTION

public static final String LEN_OPTION
See Also:
Constant Field Values

FILTER_OPTION

public static final String FILTER_OPTION
See Also:
Constant Field Values

JOBTYPE_OPTION

public static final String JOBTYPE_OPTION
See Also:
Constant Field Values

SYSTEM_MODE_OPTION

public static final String SYSTEM_MODE_OPTION
See Also:
Constant Field Values

VERSION_OPTION

public static final String VERSION_OPTION
See Also:
Constant Field Values

STATUS_OPTION

public static final String STATUS_OPTION
See Also:
Constant Field Values

LOCAL_TIME_OPTION

public static final String LOCAL_TIME_OPTION
See Also:
Constant Field Values

QUEUE_DUMP_OPTION

public static final String QUEUE_DUMP_OPTION
See Also:
Constant Field Values

RERUN_COORD_OPTION

public static final String RERUN_COORD_OPTION
See Also:
Constant Field Values

DATE_OPTION

public static final String DATE_OPTION
See Also:
Constant Field Values

RERUN_REFRESH_OPTION

public static final String RERUN_REFRESH_OPTION
See Also:
Constant Field Values

RERUN_NOCLEANUP_OPTION

public static final String RERUN_NOCLEANUP_OPTION
See Also:
Constant Field Values

VERBOSE_OPTION

public static final String VERBOSE_OPTION
See Also:
Constant Field Values

VERBOSE_DELIMITER

public static final String VERBOSE_DELIMITER
See Also:
Constant Field Values

PIGFILE_OPTION

public static final String PIGFILE_OPTION
See Also:
Constant Field Values
Constructor Detail

OozieCLI

public OozieCLI()
Create an Oozie CLI instance.

Method Detail

main

public static void main(String[] args)
Entry point for the Oozie CLI when invoked from the command line.

Upon completion this method exits the JVM with '0' (success) or '-1' (failure).

Parameters:
args - options and arguments for the Oozie CLI.

getCLIHelp

protected String[] getCLIHelp()
Return Oozie CLI top help lines.

Returns:
help lines.

createAdminOptions

protected org.apache.commons.cli.Options createAdminOptions()

createJobOptions

protected org.apache.commons.cli.Options createJobOptions()

createJobsOptions

protected org.apache.commons.cli.Options createJobsOptions()

createSlaOptions

protected org.apache.commons.cli.Options createSlaOptions()

createPigOptions

protected org.apache.commons.cli.Options createPigOptions()

run

public int run(String[] args)
Run a CLI programmatically.

It does not exit the JVM.

A CLI instance can be used only once.

Parameters:
args - options and arguments for the Oozie CLI.
Returns:
'0' (success), '-1' (failure).

getOozieUrl

protected String getOozieUrl(org.apache.commons.cli.CommandLine commandLine)

createOozieClient

protected OozieClient createOozieClient(org.apache.commons.cli.CommandLine commandLine)
                                 throws OozieCLIException
Create a OozieClient.

It injects any '-Dheader:' as header to the the OozieClient.

Parameters:
commandLine - the parsed command line options.
Returns:
a pre configured eXtended workflow client.
Throws:
OozieCLIException - thrown if the OozieClient could not be configured.

createXOozieClient

protected XOozieClient createXOozieClient(org.apache.commons.cli.CommandLine commandLine)
                                   throws OozieCLIException
Create a XOozieClient.

It injects any '-Dheader:' as header to the the OozieClient.

Parameters:
commandLine - the parsed command line options.
Returns:
a pre configured eXtended workflow client.
Throws:
OozieCLIException - thrown if the XOozieClient could not be configured.

setDebugMode

protected void setDebugMode(OozieClient wc)


Copyright © 2012 Apache Software Foundation. All Rights Reserved.