public class JobContextImpl extends java.lang.Object implements JobContext
| Modifier and Type | Field and Description |
|---|---|
protected JobConf |
conf |
protected org.apache.hadoop.security.Credentials |
credentials |
protected org.apache.hadoop.security.UserGroupInformation |
ugi
The UserGroupInformation object that has a reference to the current user
|
CACHE_ARCHIVES_VISIBILITIES, CACHE_FILE_VISIBILITIES, COMBINE_CLASS_ATTR, INPUT_FORMAT_CLASS_ATTR, JAR_UNPACK_PATTERN, JOB_ACL_MODIFY_JOB, JOB_ACL_VIEW_JOB, JOB_CANCEL_DELEGATION_TOKEN, JOB_NAMENODES, MAP_CLASS_ATTR, MAP_MEMORY_PHYSICAL_MB, MAP_OUTPUT_COLLECTOR_CLASS_ATTR, MAPREDUCE_TASK_CLASSPATH_PRECEDENCE, OUTPUT_FORMAT_CLASS_ATTR, PARTITIONER_CLASS_ATTR, REDUCE_CLASS_ATTR, REDUCE_MEMORY_PHYSICAL_MB, SHUFFLE_CONSUMER_PLUGIN_ATTR, USER_LOG_RETAIN_HOURS| Constructor and Description |
|---|
JobContextImpl(org.apache.hadoop.conf.Configuration conf,
JobID jobId) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.fs.Path[] |
getArchiveClassPaths()
Get the archive entries in classpath as an array of Path
|
java.lang.String[] |
getArchiveTimestamps()
Get the timestamps of the archives.
|
java.net.URI[] |
getCacheArchives()
Get cache archives set in the Configuration
|
java.net.URI[] |
getCacheFiles()
Get cache files set in the Configuration
|
java.lang.Class<? extends Reducer<?,?,?,?>> |
getCombinerClass()
Get the combiner class for the job.
|
org.apache.hadoop.io.RawComparator<?> |
getCombinerKeyGroupingComparator()
Get the user defined
RawComparator comparator for
grouping keys of inputs to the combiner. |
org.apache.hadoop.conf.Configuration |
getConfiguration()
Return the configuration for the job.
|
org.apache.hadoop.security.Credentials |
getCredentials()
Get credentials for the job.
|
org.apache.hadoop.fs.Path[] |
getFileClassPaths()
Get the file entries in classpath as an array of Path
|
java.lang.String[] |
getFileTimestamps()
Get the timestamps of the files.
|
org.apache.hadoop.io.RawComparator<?> |
getGroupingComparator()
Get the user defined
RawComparator comparator for
grouping keys of inputs to the reduce. |
java.lang.Class<? extends InputFormat<?,?>> |
getInputFormatClass()
Get the
InputFormat class for the job. |
java.lang.String |
getJar()
Get the pathname of the job's jar.
|
JobID |
getJobID()
Get the unique ID for the job.
|
java.lang.String |
getJobName()
Get the user-specified job name.
|
boolean |
getJobSetupCleanupNeeded()
Get whether job-setup and job-cleanup is needed for the job
|
org.apache.hadoop.fs.Path[] |
getLocalCacheArchives()
Return the path array of the localized caches
|
org.apache.hadoop.fs.Path[] |
getLocalCacheFiles()
Return the path array of the localized files
|
java.lang.Class<?> |
getMapOutputKeyClass()
Get the key class for the map output data.
|
java.lang.Class<?> |
getMapOutputValueClass()
Get the value class for the map output data.
|
java.lang.Class<? extends Mapper<?,?,?,?>> |
getMapperClass()
Get the
Mapper class for the job. |
int |
getMaxMapAttempts()
Get the configured number of maximum attempts that will be made to run a
map task, as specified by the
mapred.map.max.attempts
property. |
int |
getMaxReduceAttempts()
Get the configured number of maximum attempts that will be made to run a
reduce task, as specified by the
mapred.reduce.max.attempts
property. |
int |
getNumReduceTasks()
Get configured the number of reduce tasks for this job.
|
java.lang.Class<? extends OutputFormat<?,?>> |
getOutputFormatClass()
Get the
OutputFormat class for the job. |
java.lang.Class<?> |
getOutputKeyClass()
Get the key class for the job output data.
|
java.lang.Class<?> |
getOutputValueClass()
Get the value class for job outputs.
|
java.lang.Class<? extends Partitioner<?,?>> |
getPartitionerClass()
Get the
Partitioner class for the job. |
boolean |
getProfileEnabled()
Get whether the task profiling is enabled.
|
java.lang.String |
getProfileParams()
Get the profiler configuration arguments.
|
org.apache.hadoop.conf.Configuration.IntegerRanges |
getProfileTaskRange(boolean isMap)
Get the range of maps or reduces to profile.
|
java.lang.Class<? extends Reducer<?,?,?,?>> |
getReducerClass()
Get the
Reducer class for the job. |
org.apache.hadoop.io.RawComparator<?> |
getSortComparator()
Get the
RawComparator comparator used to compare keys. |
boolean |
getSymlink()
This method checks to see if symlinks are to be create for the
localized cache files in the current working directory
|
java.lang.String |
getUser()
Get the reported username for this job.
|
org.apache.hadoop.fs.Path |
getWorkingDirectory()
Get the current working directory for the default file system.
|
void |
setJobID(JobID jobId)
Set the JobID.
|
boolean |
userClassesTakesPrecedence()
Get the boolean value for the property that specifies which classpath
takes precedence when tasks are launched.
|
protected final JobConf conf
protected org.apache.hadoop.security.UserGroupInformation ugi
protected final org.apache.hadoop.security.Credentials credentials
public JobContextImpl(org.apache.hadoop.conf.Configuration conf,
JobID jobId)
public org.apache.hadoop.conf.Configuration getConfiguration()
getConfiguration in interface JobContextpublic JobID getJobID()
getJobID in interface JobContextpublic void setJobID(JobID jobId)
public int getNumReduceTasks()
1.getNumReduceTasks in interface JobContextpublic org.apache.hadoop.fs.Path getWorkingDirectory()
throws java.io.IOException
getWorkingDirectory in interface JobContextjava.io.IOExceptionpublic java.lang.Class<?> getOutputKeyClass()
getOutputKeyClass in interface JobContextpublic java.lang.Class<?> getOutputValueClass()
getOutputValueClass in interface JobContextpublic java.lang.Class<?> getMapOutputKeyClass()
getMapOutputKeyClass in interface JobContextpublic java.lang.Class<?> getMapOutputValueClass()
getMapOutputValueClass in interface JobContextpublic java.lang.String getJobName()
getJobName in interface JobContextpublic boolean userClassesTakesPrecedence()
userClassesTakesPrecedence in interface JobContextpublic java.lang.Class<? extends InputFormat<?,?>> getInputFormatClass() throws java.lang.ClassNotFoundException
InputFormat class for the job.getInputFormatClass in interface JobContextInputFormat class for the job.java.lang.ClassNotFoundExceptionpublic java.lang.Class<? extends Mapper<?,?,?,?>> getMapperClass() throws java.lang.ClassNotFoundException
Mapper class for the job.getMapperClass in interface JobContextMapper class for the job.java.lang.ClassNotFoundExceptionpublic java.lang.Class<? extends Reducer<?,?,?,?>> getCombinerClass() throws java.lang.ClassNotFoundException
getCombinerClass in interface JobContextjava.lang.ClassNotFoundExceptionpublic java.lang.Class<? extends Reducer<?,?,?,?>> getReducerClass() throws java.lang.ClassNotFoundException
Reducer class for the job.getReducerClass in interface JobContextReducer class for the job.java.lang.ClassNotFoundExceptionpublic java.lang.Class<? extends OutputFormat<?,?>> getOutputFormatClass() throws java.lang.ClassNotFoundException
OutputFormat class for the job.getOutputFormatClass in interface JobContextOutputFormat class for the job.java.lang.ClassNotFoundExceptionpublic java.lang.Class<? extends Partitioner<?,?>> getPartitionerClass() throws java.lang.ClassNotFoundException
Partitioner class for the job.getPartitionerClass in interface JobContextPartitioner class for the job.java.lang.ClassNotFoundExceptionpublic org.apache.hadoop.io.RawComparator<?> getSortComparator()
RawComparator comparator used to compare keys.getSortComparator in interface JobContextRawComparator comparator used to compare keys.public java.lang.String getJar()
getJar in interface JobContextpublic org.apache.hadoop.io.RawComparator<?> getCombinerKeyGroupingComparator()
RawComparator comparator for
grouping keys of inputs to the combiner.getCombinerKeyGroupingComparator in interface JobContextfor details.public org.apache.hadoop.io.RawComparator<?> getGroupingComparator()
RawComparator comparator for
grouping keys of inputs to the reduce.getGroupingComparator in interface JobContextfor details.public boolean getJobSetupCleanupNeeded()
getJobSetupCleanupNeeded in interface JobContextpublic boolean getSymlink()
getSymlink in interface JobContextpublic org.apache.hadoop.fs.Path[] getArchiveClassPaths()
getArchiveClassPaths in interface JobContextpublic java.net.URI[] getCacheArchives()
throws java.io.IOException
getCacheArchives in interface JobContextjava.io.IOExceptionpublic java.net.URI[] getCacheFiles()
throws java.io.IOException
getCacheFiles in interface JobContextjava.io.IOExceptionpublic org.apache.hadoop.fs.Path[] getLocalCacheArchives()
throws java.io.IOException
getLocalCacheArchives in interface JobContextjava.io.IOExceptionpublic org.apache.hadoop.fs.Path[] getLocalCacheFiles()
throws java.io.IOException
getLocalCacheFiles in interface JobContextjava.io.IOExceptionpublic org.apache.hadoop.fs.Path[] getFileClassPaths()
getFileClassPaths in interface JobContextpublic java.lang.String[] getArchiveTimestamps()
getArchiveTimestamps in interface JobContextjava.io.IOExceptionpublic java.lang.String[] getFileTimestamps()
getFileTimestamps in interface JobContextjava.io.IOExceptionpublic int getMaxMapAttempts()
mapred.map.max.attempts
property. If this property is not already set, the default is 4 attempts.getMaxMapAttempts in interface JobContextpublic int getMaxReduceAttempts()
mapred.reduce.max.attempts
property. If this property is not already set, the default is 4 attempts.getMaxReduceAttempts in interface JobContextpublic boolean getProfileEnabled()
getProfileEnabled in interface JobContextpublic java.lang.String getProfileParams()
getProfileParams in interface JobContextpublic org.apache.hadoop.conf.Configuration.IntegerRanges getProfileTaskRange(boolean isMap)
isMap - is the task a map?public java.lang.String getUser()
getUser in interface JobContextpublic org.apache.hadoop.security.Credentials getCredentials()
JobContextgetCredentials in interface JobContextCopyright © 2009 The Apache Software Foundation