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 AUTH_OPTION
           
static String BULK_OPTION
           
static String CHANGE_OPTION
           
static String CHANGE_VALUE_OPTION
           
static String CONFIG_CONTENT_OPTION
           
static String CONFIG_OPTION
           
static String DATE_OPTION
           
static String DEBUG_OPTION
           
static String DEFINITION_OPTION
           
static String DO_AS_OPTION
           
static String DRYRUN_OPTION
           
static String ENV_OOZIE_DEBUG
           
static String ENV_OOZIE_TIME_ZONE
           
static String ENV_OOZIE_URL
           
static String FILTER_OPTION
           
static String HELP_CMD
           
static String INFO_CMD
           
static String INFO_OPTION
           
static String INFO_TIME_ZONES_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 MR_CMD
           
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 TIME_ZONE_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  void addAuthOptions(org.apache.commons.cli.Options options)
          Add authentication specific options to oozie cli
protected  void addHeader(OozieClient wc)
           
protected  org.apache.commons.cli.Options createAdminOptions()
          Create option for command line option 'admin'
protected  org.apache.commons.cli.Options createInfoOptions()
          Create option for command line option 'info'
protected  org.apache.commons.cli.Options createJobOptions()
          Create option for command line option 'job'
protected  org.apache.commons.cli.Options createJobsOptions()
          Create option for command line option 'jobs'
protected  org.apache.commons.cli.Options createMROptions()
          Create option for command line option 'mapreduce'
protected  OozieClient createOozieClient(org.apache.commons.cli.CommandLine commandLine)
          Create a OozieClient.
protected  org.apache.commons.cli.Options createPigOptions()
          Create option for command line option 'pig'
protected  org.apache.commons.cli.Options createSlaOptions()
          Create option for command line option 'sla'
protected  XOozieClient createXOozieClient(org.apache.commons.cli.CommandLine commandLine)
          Create a XOozieClient.
protected  String getAuthOption(org.apache.commons.cli.CommandLine commandLine)
          Get auth option from command line
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, boolean debugOpt)
           
 
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

ENV_OOZIE_TIME_ZONE

public static final String ENV_OOZIE_TIME_ZONE
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

MR_CMD

public static final String MR_CMD
See Also:
Constant Field Values

INFO_CMD

public static final String INFO_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

DO_AS_OPTION

public static final String DO_AS_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

TIME_ZONE_OPTION

public static final String TIME_ZONE_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

AUTH_OPTION

public static final String AUTH_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

DEBUG_OPTION

public static final String DEBUG_OPTION
See Also:
Constant Field Values

PIGFILE_OPTION

public static final String PIGFILE_OPTION
See Also:
Constant Field Values

INFO_TIME_ZONES_OPTION

public static final String INFO_TIME_ZONES_OPTION
See Also:
Constant Field Values

BULK_OPTION

public static final String BULK_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.

addAuthOptions

protected void addAuthOptions(org.apache.commons.cli.Options options)
Add authentication specific options to oozie cli

Parameters:
options - the collection of options to add auth options

createAdminOptions

protected org.apache.commons.cli.Options createAdminOptions()
Create option for command line option 'admin'

Returns:
admin options

createJobOptions

protected org.apache.commons.cli.Options createJobOptions()
Create option for command line option 'job'

Returns:
job options

createJobsOptions

protected org.apache.commons.cli.Options createJobsOptions()
Create option for command line option 'jobs'

Returns:
jobs options

createSlaOptions

protected org.apache.commons.cli.Options createSlaOptions()
Create option for command line option 'sla'

Returns:
sla options

createPigOptions

protected org.apache.commons.cli.Options createPigOptions()
Create option for command line option 'pig'

Returns:
pig options

createInfoOptions

protected org.apache.commons.cli.Options createInfoOptions()
Create option for command line option 'info'

Returns:
info options

createMROptions

protected org.apache.commons.cli.Options createMROptions()
Create option for command line option 'mapreduce'

Returns:
mapreduce options

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)

addHeader

protected void addHeader(OozieClient wc)

getAuthOption

protected String getAuthOption(org.apache.commons.cli.CommandLine commandLine)
Get auth option from command line

Parameters:
commandLine - the command line object
Returns:
auth option

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,
                            boolean debugOpt)


Copyright © 2012 Apache Software Foundation. All Rights Reserved.