net.sf.eos.hadoop.mapred
Class AbstractEosDriver

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by net.sf.eos.hadoop.mapred.AbstractEosDriver
All Implemented Interfaces:
Configurable, Tool
Direct Known Subclasses:
DictionaryBasedEntityRecognizerMapReduceDriver, IndexMapReduceDriver, SentenceMapReduceDriver

public abstract class AbstractEosDriver
extends Configured
implements Tool

Support for some generic configuration data. The run(String[]) analyze the parameter "-s" or "--source" for the source (input-Path) parameter and "-d" or "--dest" for the destination (output-Path).

Author:
Sascha Kohlmann

Field Summary
static String DESTINATION_LONG_CMD_ARG
          Long commandline parameter name for the destination or output path.
static String DESTINATION_SHORT_CMD_ARG
          Short commandline parameter name for the destination or output path.
static String SOURCE_LONG_CMD_ARG
          Long commandline parameter name for the source or input path.
static String SOURCE_SHORT_CMD_ARG
          Short commandline parameter name for the source or input path.
 
Constructor Summary
AbstractEosDriver()
           
 
Method Summary
protected  org.apache.commons.cli.Options createOptions()
           
protected  int doJob(JobConf conf)
          Runs the job for the given configuration.
protected  JobConf getJobConf()
          Returns the job configuration.
 int run(String[] args)
          Implementations of AbstractEosDriver must call super.run(String[]).
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Field Detail

SOURCE_SHORT_CMD_ARG

public static final String SOURCE_SHORT_CMD_ARG
Short commandline parameter name for the source or input path.

See Also:
Constant Field Values

SOURCE_LONG_CMD_ARG

public static final String SOURCE_LONG_CMD_ARG
Long commandline parameter name for the source or input path.

See Also:
Constant Field Values

DESTINATION_SHORT_CMD_ARG

public static final String DESTINATION_SHORT_CMD_ARG
Short commandline parameter name for the destination or output path.

See Also:
Constant Field Values

DESTINATION_LONG_CMD_ARG

public static final String DESTINATION_LONG_CMD_ARG
Long commandline parameter name for the destination or output path.

See Also:
Constant Field Values
Constructor Detail

AbstractEosDriver

public AbstractEosDriver()
Method Detail

run

public int run(String[] args)
        throws Exception
Implementations of AbstractEosDriver must call super.run(String[]). After the call getJobConf() returns a value != null.

Never starts a job. This is part of the implementing driver.

Specified by:
run in interface Tool
Returns:
always zero.
Throws:
Exception

getJobConf

protected final JobConf getJobConf()
Returns the job configuration. Throws an exception if method was called before an implementation calls run(String[]).

Returns:
the job configuration
Throws:
IllegalStateException - if called before run(String[])

createOptions

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

doJob

protected int doJob(JobConf conf)
             throws Exception
Runs the job for the given configuration.

Parameters:
conf - the job configuration
Returns:
the job status. 0 if the job success. 1 if the job fails.
Throws:
Exception - if an error occurs


Copyright © 2008. All Rights Reserved.