org.apache.oozie.service
Class WorkflowAppService

java.lang.Object
  extended by org.apache.oozie.service.WorkflowAppService
All Implemented Interfaces:
Service
Direct Known Subclasses:
LiteWorkflowAppService

public abstract class WorkflowAppService
extends Object
implements Service

Service that provides application workflow definition reading from the path and creation of the proto configuration.


Field Summary
static String APP_LIB_PATH_LIST
           
static String CONF_PREFIX
           
static String CONFG_MAX_WF_LENGTH
           
static String HADOOP_USER
           
static String OOZIE_SUBWORKFLOW_CLASSPATH_INHERITANCE
           
static String OOZIE_WF_SUBWORKFLOW_CLASSPATH_INHERITANCE
           
static String SYSTEM_LIB_PATH
           
 
Fields inherited from interface org.apache.oozie.service.Service
DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND
 
Constructor Summary
WorkflowAppService()
           
 
Method Summary
 XConfiguration createProtoActionConf(org.apache.hadoop.conf.Configuration jobConf, String authToken, boolean isWorkflowJob)
          Create proto configuration.
 void destroy()
          Destroy the workflow application service.
 Class<? extends Service> getInterface()
          Return the public interface for workflow application service.
 org.apache.hadoop.fs.Path getSystemLibPath()
          Returns Oozie system libpath.
 void init(Services services)
          Initialize the workflow application service.
abstract  WorkflowApp parseDef(org.apache.hadoop.conf.Configuration jobConf, String authToken)
          Parse workflow definition.
abstract  WorkflowApp parseDef(String wfXml, org.apache.hadoop.conf.Configuration jobConf)
          Parse workflow definition.
protected  String readDefinition(String appPath, String user, String autToken, org.apache.hadoop.conf.Configuration conf)
          Read workflow definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_PREFIX

public static final String CONF_PREFIX
See Also:
Constant Field Values

SYSTEM_LIB_PATH

public static final String SYSTEM_LIB_PATH
See Also:
Constant Field Values

APP_LIB_PATH_LIST

public static final String APP_LIB_PATH_LIST
See Also:
Constant Field Values

HADOOP_USER

public static final String HADOOP_USER
See Also:
Constant Field Values

CONFG_MAX_WF_LENGTH

public static final String CONFG_MAX_WF_LENGTH
See Also:
Constant Field Values

OOZIE_SUBWORKFLOW_CLASSPATH_INHERITANCE

public static final String OOZIE_SUBWORKFLOW_CLASSPATH_INHERITANCE
See Also:
Constant Field Values

OOZIE_WF_SUBWORKFLOW_CLASSPATH_INHERITANCE

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

WorkflowAppService

public WorkflowAppService()
Method Detail

init

public void init(Services services)
Initialize the workflow application service.

Specified by:
init in interface Service
Parameters:
services - services instance.

destroy

public void destroy()
Destroy the workflow application service.

Specified by:
destroy in interface Service

getInterface

public Class<? extends Service> getInterface()
Return the public interface for workflow application service.

Specified by:
getInterface in interface Service
Returns:
WorkflowAppService.

readDefinition

protected String readDefinition(String appPath,
                                String user,
                                String autToken,
                                org.apache.hadoop.conf.Configuration conf)
                         throws WorkflowException
Read workflow definition.

Parameters:
appPath - application path.
user - user name.
autToken - authentication token.
Returns:
workflow definition.
Throws:
WorkflowException - thrown if the definition could not be read.

createProtoActionConf

public XConfiguration createProtoActionConf(org.apache.hadoop.conf.Configuration jobConf,
                                            String authToken,
                                            boolean isWorkflowJob)
                                     throws WorkflowException
Create proto configuration.

The proto configuration includes the user,group and the paths which need to be added to distributed cache. These paths include .jar,.so and the resource file paths.

Parameters:
jobConf - job configuration.
authToken - authentication token.
isWorkflowJob - indicates if the job is a workflow job or not.
Returns:
proto configuration.
Throws:
WorkflowException - thrown if the proto action configuration could not be created.

parseDef

public abstract WorkflowApp parseDef(org.apache.hadoop.conf.Configuration jobConf,
                                     String authToken)
                              throws WorkflowException
Parse workflow definition.

Parameters:
jobConf - job configuration.
authToken - authentication token.
Returns:
workflow application.
Throws:
WorkflowException - thrown if the workflow application could not be parsed.

parseDef

public abstract WorkflowApp parseDef(String wfXml,
                                     org.apache.hadoop.conf.Configuration jobConf)
                              throws WorkflowException
Parse workflow definition.

Parameters:
wfXml - workflow.
jobConf - job configuration
Returns:
workflow application.
Throws:
WorkflowException - thrown if the workflow application could not be parsed.

getSystemLibPath

public org.apache.hadoop.fs.Path getSystemLibPath()
Returns Oozie system libpath.

Returns:
Oozie system libpath (sharelib) in HDFS if present, otherwise it returns NULL.


Copyright © 2013 Apache Software Foundation. All Rights Reserved.