K
- the type of the input keysV
- the type of the input values
public abstract class BaseJob<K,V>
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
Modifier and Type | Field and Description |
---|---|
protected CmdArgsParser |
argsp |
protected AbstractInputDataSet |
inputDataSet |
protected java.lang.Class<?> |
jarClass |
protected org.apache.hadoop.fs.Path |
jobRegEntryPath |
protected FileInputDataSet |
proxyIDS |
Constructor and Description |
---|
BaseJob() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.hadoop.fs.Path |
addJobRegistryEntry(org.apache.hadoop.fs.Path jobRegEntryPath, org.apache.hadoop.mapreduce.Job job) |
protected org.apache.hadoop.fs.Path |
addJobRegistryEntry(org.apache.hadoop.fs.Path jobRegEntryPath, oracle.spatial.hadoop.commons.logging.registry.JobRegistryEntry jobRegEntry, org.apache.hadoop.conf.Configuration conf) |
protected org.apache.hadoop.fs.Path |
addJobRegistryEntry(org.apache.hadoop.fs.Path jobRegEntryPath, org.apache.hadoop.mapred.RunningJob runningJob) |
void |
configure(org.apache.hadoop.mapreduce.Job job)
Validates and adds the current parameters to the job configuration
|
void |
configure(org.apache.hadoop.mapred.JobConf jobConf)
Validates and adds the current parameters to the job configuration
|
protected org.apache.hadoop.mapreduce.Job |
createJob() |
protected org.apache.hadoop.mapreduce.Job |
createJob(org.apache.hadoop.conf.Configuration conf) |
protected org.apache.hadoop.mapreduce.Job |
createJob(org.apache.hadoop.conf.Configuration conf, java.lang.String jobName) |
protected org.apache.hadoop.mapreduce.Job |
createJob(org.apache.hadoop.conf.Configuration conf, java.lang.String jobName, java.lang.String jar) |
protected org.apache.hadoop.mapred.JobConf |
createJobConf()
Creates a job configuration
|
protected org.apache.hadoop.mapred.JobConf |
createJobConf(org.apache.hadoop.mapred.JobConf baseConf) |
protected org.apache.hadoop.mapred.JobConf |
createJobConf(org.apache.hadoop.mapred.JobConf baseConf, java.lang.String jobName) |
java.lang.String |
getCmdOptions()
Gets a description of the arguments expected from command line.
|
java.lang.String |
getCmdOptionsWithInputDataSets()
Gets a descriptive text about the parameters expected by the job plus a description of the supported input data set types
|
protected java.lang.String |
getCmdOptionsWithInputDataSets(InputDataSetCmdArgsParserHandler parserHandler) |
java.util.Map<java.lang.String,java.lang.Object> |
getCurrentCmdArgs(org.apache.hadoop.conf.Configuration conf)
Returns the current driver properties in a map where each key-value is a name and value of a command line argument.
|
java.lang.String |
getCurrentCmdArgsAsString(org.apache.hadoop.conf.Configuration conf)
Returns the current driver properties as a space-separated list of name=value elements.
|
protected void |
getCurrentCmdArgsAsString(java.util.Map<java.lang.String,java.lang.Object> cmdArgs, java.lang.StringBuilder buff) |
java.lang.String |
getInput()
Gets the job input string
|
AbstractInputDataSet |
getInputDataSet()
Gets the current input data set
|
protected abstract InputDataSetCmdArgsParserHandler |
getInputDataSetCmdParserHandler(org.apache.hadoop.conf.Configuration conf)
Gets the current instance of
InputDataSetCmdArgsParserHandler used to parse command line parameters for the input data set |
protected abstract InputDataSetConfiguratorHandler |
getInputDataSetConfiguratorHandler(org.apache.hadoop.conf.Configuration conf)
Returns the current instance of
InputDataSetConfiguratorHandler used to configure the input data set |
java.lang.Class<?> |
getInputFormatClass()
Gets the input format used to read the input data
|
java.lang.Class<?> |
getJarClass() |
java.lang.String |
getOutput()
Gets the job output path
|
java.lang.Class<? extends RecordInfoProvider<K,V>> |
getRecordInfoProviderClass()
Gets the
RecordInfoProvider class used to interpret input records. |
SpatialConfig |
getSpatialConfig()
Gets the spatial configuration that describes the geometries in the input data.
|
void |
processArgs(java.lang.String[] args, org.apache.hadoop.conf.Configuration conf)
Extracts and validates arguments from the command line
|
protected boolean |
runJob(org.apache.hadoop.mapreduce.Job job) |
protected org.apache.hadoop.mapred.RunningJob |
runJob(org.apache.hadoop.mapred.JobConf jobConf) |
void |
setInput(java.lang.String input)
Sets the job input string
|
void |
setInputDataSet(AbstractInputDataSet inputDataSet) |
void |
setInputFormatClass(java.lang.Class<?> inputFormatClass)
Sets the input format used to read the input data
|
void |
setJarClass(java.lang.Class<?> jarClass) |
void |
setOutput(java.lang.String output)
Sets the job output
|
void |
setRecordInfoProviderClass(java.lang.Class<? extends RecordInfoProvider<K,V>> recordInfoProviderClass)
Sets the
RecordInfoProvider class used to interpret input records. |
void |
setSpatialConfig(SpatialConfig spatialConfig)
Sets the spatial configuration that describes the geometries in the input data.
|
protected void |
updateInputDataSet() |
protected CmdArgsParser argsp
protected java.lang.Class<?> jarClass
protected AbstractInputDataSet inputDataSet
protected FileInputDataSet proxyIDS
protected org.apache.hadoop.fs.Path jobRegEntryPath
protected abstract InputDataSetConfiguratorHandler getInputDataSetConfiguratorHandler(org.apache.hadoop.conf.Configuration conf)
InputDataSetConfiguratorHandler
used to configure the input data setconf
- a job configurationInputDataSetConfiguratorHandler
protected abstract InputDataSetCmdArgsParserHandler getInputDataSetCmdParserHandler(org.apache.hadoop.conf.Configuration conf)
InputDataSetCmdArgsParserHandler
used to parse command line parameters for the input data setconf
- a job configurationInputDataSetCmdArgsParserHandler
public void setInputDataSet(AbstractInputDataSet inputDataSet)
public AbstractInputDataSet getInputDataSet()
AbstractInputDataSet
public java.lang.String getInput()
public void setInput(java.lang.String input)
input
- a path, comma-separated paths or a path patternpublic java.lang.String getOutput()
public void setOutput(java.lang.String output)
output
- a pathpublic java.lang.Class<?> getInputFormatClass()
public void setInputFormatClass(java.lang.Class<?> inputFormatClass)
inputFormatClass
- an InputFormat subclasspublic java.lang.Class<? extends RecordInfoProvider<K,V>> getRecordInfoProviderClass()
RecordInfoProvider
class used to interpret input records.RecordInfoProvider
subclasspublic void setRecordInfoProviderClass(java.lang.Class<? extends RecordInfoProvider<K,V>> recordInfoProviderClass)
RecordInfoProvider
class used to interpret input records.recordInfoProviderClass
- a RecordInfoProvider
subclasspublic void setSpatialConfig(SpatialConfig spatialConfig)
spatialConfig
- the spatial configurationpublic SpatialConfig getSpatialConfig()
public void setJarClass(java.lang.Class<?> jarClass)
public java.lang.Class<?> getJarClass()
public void processArgs(java.lang.String[] args, org.apache.hadoop.conf.Configuration conf) throws java.lang.Exception
args
- arguments from the command lineconf
- the job configurationjava.lang.Exception
public java.util.Map<java.lang.String,java.lang.Object> getCurrentCmdArgs(org.apache.hadoop.conf.Configuration conf)
conf
- a job configurationpublic java.lang.String getCurrentCmdArgsAsString(org.apache.hadoop.conf.Configuration conf)
conf
- a job configurationprotected void getCurrentCmdArgsAsString(java.util.Map<java.lang.String,java.lang.Object> cmdArgs, java.lang.StringBuilder buff)
public java.lang.String getCmdOptionsWithInputDataSets()
protected java.lang.String getCmdOptionsWithInputDataSets(InputDataSetCmdArgsParserHandler parserHandler)
public java.lang.String getCmdOptions()
public void configure(org.apache.hadoop.mapred.JobConf jobConf) throws java.lang.Exception
jobConf
- the job configurationjava.lang.Exception
public void configure(org.apache.hadoop.mapreduce.Job job) throws java.lang.Exception
job
- a job instancejava.lang.Exception
protected org.apache.hadoop.mapred.JobConf createJobConf()
protected org.apache.hadoop.mapred.JobConf createJobConf(org.apache.hadoop.mapred.JobConf baseConf)
protected org.apache.hadoop.mapred.JobConf createJobConf(org.apache.hadoop.mapred.JobConf baseConf, java.lang.String jobName)
protected org.apache.hadoop.mapreduce.Job createJob() throws java.io.IOException
java.io.IOException
protected org.apache.hadoop.mapreduce.Job createJob(org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
java.io.IOException
protected org.apache.hadoop.mapreduce.Job createJob(org.apache.hadoop.conf.Configuration conf, java.lang.String jobName) throws java.io.IOException
java.io.IOException
protected org.apache.hadoop.mapreduce.Job createJob(org.apache.hadoop.conf.Configuration conf, java.lang.String jobName, java.lang.String jar) throws java.io.IOException
java.io.IOException
protected void updateInputDataSet()
protected org.apache.hadoop.fs.Path addJobRegistryEntry(org.apache.hadoop.fs.Path jobRegEntryPath, org.apache.hadoop.mapred.RunningJob runningJob)
protected org.apache.hadoop.fs.Path addJobRegistryEntry(org.apache.hadoop.fs.Path jobRegEntryPath, org.apache.hadoop.mapreduce.Job job)
protected org.apache.hadoop.fs.Path addJobRegistryEntry(org.apache.hadoop.fs.Path jobRegEntryPath, oracle.spatial.hadoop.commons.logging.registry.JobRegistryEntry jobRegEntry, org.apache.hadoop.conf.Configuration conf)
protected org.apache.hadoop.mapred.RunningJob runJob(org.apache.hadoop.mapred.JobConf jobConf) throws java.lang.Exception
java.lang.Exception
protected boolean runJob(org.apache.hadoop.mapreduce.Job job) throws java.lang.Exception
java.lang.Exception
Copyright © 2016 Oracle and/or its affiliates. All Rights Reserved.