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 JobContext
public JobID getJobID()
getJobID
in interface JobContext
public void setJobID(JobID jobId)
public int getNumReduceTasks()
1
.getNumReduceTasks
in interface JobContext
public org.apache.hadoop.fs.Path getWorkingDirectory() throws java.io.IOException
getWorkingDirectory
in interface JobContext
java.io.IOException
public java.lang.Class<?> getOutputKeyClass()
getOutputKeyClass
in interface JobContext
public java.lang.Class<?> getOutputValueClass()
getOutputValueClass
in interface JobContext
public java.lang.Class<?> getMapOutputKeyClass()
getMapOutputKeyClass
in interface JobContext
public java.lang.Class<?> getMapOutputValueClass()
getMapOutputValueClass
in interface JobContext
public java.lang.String getJobName()
getJobName
in interface JobContext
public boolean userClassesTakesPrecedence()
userClassesTakesPrecedence
in interface JobContext
public java.lang.Class<? extends InputFormat<?,?>> getInputFormatClass() throws java.lang.ClassNotFoundException
InputFormat
class for the job.getInputFormatClass
in interface JobContext
InputFormat
class for the job.java.lang.ClassNotFoundException
public java.lang.Class<? extends Mapper<?,?,?,?>> getMapperClass() throws java.lang.ClassNotFoundException
Mapper
class for the job.getMapperClass
in interface JobContext
Mapper
class for the job.java.lang.ClassNotFoundException
public java.lang.Class<? extends Reducer<?,?,?,?>> getCombinerClass() throws java.lang.ClassNotFoundException
getCombinerClass
in interface JobContext
java.lang.ClassNotFoundException
public java.lang.Class<? extends Reducer<?,?,?,?>> getReducerClass() throws java.lang.ClassNotFoundException
Reducer
class for the job.getReducerClass
in interface JobContext
Reducer
class for the job.java.lang.ClassNotFoundException
public java.lang.Class<? extends OutputFormat<?,?>> getOutputFormatClass() throws java.lang.ClassNotFoundException
OutputFormat
class for the job.getOutputFormatClass
in interface JobContext
OutputFormat
class for the job.java.lang.ClassNotFoundException
public java.lang.Class<? extends Partitioner<?,?>> getPartitionerClass() throws java.lang.ClassNotFoundException
Partitioner
class for the job.getPartitionerClass
in interface JobContext
Partitioner
class for the job.java.lang.ClassNotFoundException
public org.apache.hadoop.io.RawComparator<?> getSortComparator()
RawComparator
comparator used to compare keys.getSortComparator
in interface JobContext
RawComparator
comparator used to compare keys.public java.lang.String getJar()
getJar
in interface JobContext
public org.apache.hadoop.io.RawComparator<?> getCombinerKeyGroupingComparator()
RawComparator
comparator for
grouping keys of inputs to the combiner.getCombinerKeyGroupingComparator
in interface JobContext
for details.
public org.apache.hadoop.io.RawComparator<?> getGroupingComparator()
RawComparator
comparator for
grouping keys of inputs to the reduce.getGroupingComparator
in interface JobContext
for details.
public boolean getJobSetupCleanupNeeded()
getJobSetupCleanupNeeded
in interface JobContext
public boolean getSymlink()
getSymlink
in interface JobContext
public org.apache.hadoop.fs.Path[] getArchiveClassPaths()
getArchiveClassPaths
in interface JobContext
public java.net.URI[] getCacheArchives() throws java.io.IOException
getCacheArchives
in interface JobContext
java.io.IOException
public java.net.URI[] getCacheFiles() throws java.io.IOException
getCacheFiles
in interface JobContext
java.io.IOException
public org.apache.hadoop.fs.Path[] getLocalCacheArchives() throws java.io.IOException
getLocalCacheArchives
in interface JobContext
java.io.IOException
public org.apache.hadoop.fs.Path[] getLocalCacheFiles() throws java.io.IOException
getLocalCacheFiles
in interface JobContext
java.io.IOException
public org.apache.hadoop.fs.Path[] getFileClassPaths()
getFileClassPaths
in interface JobContext
public java.lang.String[] getArchiveTimestamps()
getArchiveTimestamps
in interface JobContext
java.io.IOException
public java.lang.String[] getFileTimestamps()
getFileTimestamps
in interface JobContext
java.io.IOException
public int getMaxMapAttempts()
mapred.map.max.attempts
property. If this property is not already set, the default is 4 attempts.getMaxMapAttempts
in interface JobContext
public int getMaxReduceAttempts()
mapred.reduce.max.attempts
property. If this property is not already set, the default is 4 attempts.getMaxReduceAttempts
in interface JobContext
public boolean getProfileEnabled()
getProfileEnabled
in interface JobContext
public java.lang.String getProfileParams()
getProfileParams
in interface JobContext
public org.apache.hadoop.conf.Configuration.IntegerRanges getProfileTaskRange(boolean isMap)
isMap
- is the task a map?public java.lang.String getUser()
getUser
in interface JobContext
public org.apache.hadoop.security.Credentials getCredentials()
JobContext
getCredentials
in interface JobContext
Copyright © 2009 The Apache Software Foundation