de.kumpe.hadooptimizer.examples
Class Example

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by de.kumpe.hadooptimizer.examples.Example
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
Direct Known Subclasses:
Convert, OptimizerExample, SvgRenderer

public abstract class Example
extends org.apache.hadoop.conf.Configured

Base class for all "executables" in the examples module. It delivers a basic infrastructure for a common workflow:

  1. createOptions()
  2. processCommandLine()
  3. execute()

Author:
Christian Kumpe

Field Summary
static String BANNER_TEXT
           
protected  String baseDir
           
static String COMMAND_LINE
          Command line key in Configuration
protected  org.apache.commons.cli.CommandLine commandLine
           
protected static org.apache.commons.logging.Log log
           
protected  PrintWriter logFile
           
protected static String OPTION_GUI
           
protected static String OPTION_HELP
           
protected static String OPTION_LOG_LEVEL
           
protected  Collection<Runnable> shutdownHooks
           
 
Constructor Summary
Example()
           
 
Method Summary
protected  org.apache.commons.cli.Options createOptions()
           
protected abstract  void execute()
           
protected abstract  String getVersionInfo()
           
 InputStream intputStream(String filename)
           
 OutputStream outputStream(String filename)
           
protected  void processCommandLine()
           
 void run(String[] args)
           
 
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
 

Field Detail

BANNER_TEXT

public static final String BANNER_TEXT
See Also:
Constant Field Values

OPTION_HELP

protected static final String OPTION_HELP
See Also:
Constant Field Values

OPTION_GUI

protected static final String OPTION_GUI
See Also:
Constant Field Values

OPTION_LOG_LEVEL

protected static final String OPTION_LOG_LEVEL
See Also:
Constant Field Values

COMMAND_LINE

public static final String COMMAND_LINE
Command line key in Configuration

See Also:
Constant Field Values

log

protected static final org.apache.commons.logging.Log log

shutdownHooks

protected final Collection<Runnable> shutdownHooks

commandLine

protected org.apache.commons.cli.CommandLine commandLine

baseDir

protected final String baseDir

logFile

protected PrintWriter logFile
Constructor Detail

Example

public Example()
Method Detail

createOptions

protected org.apache.commons.cli.Options createOptions()
                                                throws Exception
Throws:
Exception

run

public void run(String[] args)
         throws Exception
Throws:
Exception

getVersionInfo

protected abstract String getVersionInfo()

execute

protected abstract void execute()
                         throws Exception
Throws:
Exception

processCommandLine

protected void processCommandLine()
                           throws Exception
Throws:
Exception

outputStream

public OutputStream outputStream(String filename)
                          throws IOException
Throws:
IOException

intputStream

public InputStream intputStream(String filename)
                         throws IOException
Throws:
IOException


Copyright © 2011 Christian Kumpe. All Rights Reserved.