org.apache.hadoop.mapreduce
Interface JobContext

All Known Subinterfaces:
JobContext, MapContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>, ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>, TaskAttemptContext, TaskAttemptContext, TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
All Known Implementing Classes:
Job, JobContextImpl, JobContextImpl, MapContextImpl, Mapper.Context, ReduceContextImpl, Reducer.Context, TaskAttemptContextImpl, TaskAttemptContextImpl, TaskInputOutputContextImpl, WrappedMapper.Context, WrappedReducer.Context

public interface JobContext

A read-only view of the job that is provided to the tasks while they are running.


Field Summary
static java.lang.String CACHE_ARCHIVES_VISIBILITIES
           
static java.lang.String CACHE_FILE_VISIBILITIES
           
static java.lang.String COMBINE_CLASS_ATTR
           
static java.lang.String INPUT_FORMAT_CLASS_ATTR
           
static java.lang.String JAR_UNPACK_PATTERN
           
static java.lang.String JOB_ACL_MODIFY_JOB
           
static java.lang.String JOB_ACL_VIEW_JOB
           
static java.lang.String JOB_CANCEL_DELEGATION_TOKEN
           
static java.lang.String JOB_NAMENODES
           
static java.lang.String MAP_CLASS_ATTR
           
static java.lang.String MAP_MEMORY_PHYSICAL_MB
           
static java.lang.String MAP_OUTPUT_COLLECTOR_CLASS_ATTR
           
static java.lang.String MAPREDUCE_TASK_CLASSPATH_PRECEDENCE
           
static java.lang.String OUTPUT_FORMAT_CLASS_ATTR
           
static java.lang.String PARTITIONER_CLASS_ATTR
           
static java.lang.String REDUCE_CLASS_ATTR
           
static java.lang.String REDUCE_MEMORY_PHYSICAL_MB
           
static java.lang.String SHUFFLE_CONSUMER_PLUGIN_ATTR
           
static java.lang.String USER_LOG_RETAIN_HOURS
           
 
Method Summary
 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
 int getMaxReduceAttempts()
          Get the configured number of maximum attempts that will be made to run a
 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()
           
 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.
 boolean userClassesTakesPrecedence()
          Get the boolean value for the property that specifies which classpath takes precedence when tasks are launched.
 

Field Detail

INPUT_FORMAT_CLASS_ATTR

static final java.lang.String INPUT_FORMAT_CLASS_ATTR
See Also:
Constant Field Values

MAP_CLASS_ATTR

static final java.lang.String MAP_CLASS_ATTR
See Also:
Constant Field Values

MAP_OUTPUT_COLLECTOR_CLASS_ATTR

static final java.lang.String MAP_OUTPUT_COLLECTOR_CLASS_ATTR
See Also:
Constant Field Values

COMBINE_CLASS_ATTR

static final java.lang.String COMBINE_CLASS_ATTR
See Also:
Constant Field Values

SHUFFLE_CONSUMER_PLUGIN_ATTR

static final java.lang.String SHUFFLE_CONSUMER_PLUGIN_ATTR
See Also:
Constant Field Values

REDUCE_CLASS_ATTR

static final java.lang.String REDUCE_CLASS_ATTR
See Also:
Constant Field Values

OUTPUT_FORMAT_CLASS_ATTR

static final java.lang.String OUTPUT_FORMAT_CLASS_ATTR
See Also:
Constant Field Values

PARTITIONER_CLASS_ATTR

static final java.lang.String PARTITIONER_CLASS_ATTR
See Also:
Constant Field Values

JAR_UNPACK_PATTERN

static final java.lang.String JAR_UNPACK_PATTERN
See Also:
Constant Field Values

JOB_NAMENODES

static final java.lang.String JOB_NAMENODES
See Also:
Constant Field Values

JOB_ACL_VIEW_JOB

static final java.lang.String JOB_ACL_VIEW_JOB
See Also:
Constant Field Values

JOB_ACL_MODIFY_JOB

static final java.lang.String JOB_ACL_MODIFY_JOB
See Also:
Constant Field Values

CACHE_FILE_VISIBILITIES

static final java.lang.String CACHE_FILE_VISIBILITIES
See Also:
Constant Field Values

CACHE_ARCHIVES_VISIBILITIES

static final java.lang.String CACHE_ARCHIVES_VISIBILITIES
See Also:
Constant Field Values

JOB_CANCEL_DELEGATION_TOKEN

static final java.lang.String JOB_CANCEL_DELEGATION_TOKEN
See Also:
Constant Field Values

USER_LOG_RETAIN_HOURS

static final java.lang.String USER_LOG_RETAIN_HOURS
See Also:
Constant Field Values

MAPREDUCE_TASK_CLASSPATH_PRECEDENCE

static final java.lang.String MAPREDUCE_TASK_CLASSPATH_PRECEDENCE
See Also:
Constant Field Values

MAP_MEMORY_PHYSICAL_MB

static final java.lang.String MAP_MEMORY_PHYSICAL_MB
See Also:
Constant Field Values

REDUCE_MEMORY_PHYSICAL_MB

static final java.lang.String REDUCE_MEMORY_PHYSICAL_MB
See Also:
Constant Field Values
Method Detail

getConfiguration

org.apache.hadoop.conf.Configuration getConfiguration()
Return the configuration for the job.

Returns:
the shared configuration object

getCredentials

org.apache.hadoop.security.Credentials getCredentials()
Get credentials for the job.

Returns:
credentials for the job

getJobID

JobID getJobID()
Get the unique ID for the job.

Returns:
the object with the job id

getNumReduceTasks

int getNumReduceTasks()
Get configured the number of reduce tasks for this job. Defaults to 1.

Returns:
the number of reduce tasks for this job.

getWorkingDirectory

org.apache.hadoop.fs.Path getWorkingDirectory()
                                              throws java.io.IOException
Get the current working directory for the default file system.

Returns:
the directory name.
Throws:
java.io.IOException

getOutputKeyClass

java.lang.Class<?> getOutputKeyClass()
Get the key class for the job output data.

Returns:
the key class for the job output data.

getOutputValueClass

java.lang.Class<?> getOutputValueClass()
Get the value class for job outputs.

Returns:
the value class for job outputs.

getMapOutputKeyClass

java.lang.Class<?> getMapOutputKeyClass()
Get the key class for the map output data. If it is not set, use the (final) output key class. This allows the map output key class to be different than the final output key class.

Returns:
the map output key class.

getMapOutputValueClass

java.lang.Class<?> getMapOutputValueClass()
Get the value class for the map output data. If it is not set, use the (final) output value class This allows the map output value class to be different than the final output value class.

Returns:
the map output value class.

getJobName

java.lang.String getJobName()
Get the user-specified job name. This is only used to identify the job to the user.

Returns:
the job's name, defaulting to "".

userClassesTakesPrecedence

boolean userClassesTakesPrecedence()
Get the boolean value for the property that specifies which classpath takes precedence when tasks are launched. True - user's classes takes precedence. False - system's classes takes precedence.

Returns:
true if user's classes should take precedence

getInputFormatClass

java.lang.Class<? extends InputFormat<?,?>> getInputFormatClass()
                                                                throws java.lang.ClassNotFoundException
Get the InputFormat class for the job.

Returns:
the InputFormat class for the job.
Throws:
java.lang.ClassNotFoundException

getMapperClass

java.lang.Class<? extends Mapper<?,?,?,?>> getMapperClass()
                                                          throws java.lang.ClassNotFoundException
Get the Mapper class for the job.

Returns:
the Mapper class for the job.
Throws:
java.lang.ClassNotFoundException

getCombinerClass

java.lang.Class<? extends Reducer<?,?,?,?>> getCombinerClass()
                                                             throws java.lang.ClassNotFoundException
Get the combiner class for the job.

Returns:
the combiner class for the job.
Throws:
java.lang.ClassNotFoundException

getReducerClass

java.lang.Class<? extends Reducer<?,?,?,?>> getReducerClass()
                                                            throws java.lang.ClassNotFoundException
Get the Reducer class for the job.

Returns:
the Reducer class for the job.
Throws:
java.lang.ClassNotFoundException

getOutputFormatClass

java.lang.Class<? extends OutputFormat<?,?>> getOutputFormatClass()
                                                                  throws java.lang.ClassNotFoundException
Get the OutputFormat class for the job.

Returns:
the OutputFormat class for the job.
Throws:
java.lang.ClassNotFoundException

getPartitionerClass

java.lang.Class<? extends Partitioner<?,?>> getPartitionerClass()
                                                                throws java.lang.ClassNotFoundException
Get the Partitioner class for the job.

Returns:
the Partitioner class for the job.
Throws:
java.lang.ClassNotFoundException

getSortComparator

org.apache.hadoop.io.RawComparator<?> getSortComparator()
Get the RawComparator comparator used to compare keys.

Returns:
the RawComparator comparator used to compare keys.

getJar

java.lang.String getJar()
Get the pathname of the job's jar.

Returns:
the pathname

getCombinerKeyGroupingComparator

org.apache.hadoop.io.RawComparator<?> getCombinerKeyGroupingComparator()
Get the user defined RawComparator comparator for grouping keys of inputs to the combiner.

Returns:
comparator set by the user for grouping values.
See Also:
Job.setCombinerKeyGroupingComparatorClass(Class)

getGroupingComparator

org.apache.hadoop.io.RawComparator<?> getGroupingComparator()
Get the user defined RawComparator comparator for grouping keys of inputs to the reduce.

Returns:
comparator set by the user for grouping values.
See Also:
for details., getCombinerKeyGroupingComparator()

getJobSetupCleanupNeeded

boolean getJobSetupCleanupNeeded()
Get whether job-setup and job-cleanup is needed for the job

Returns:
boolean

getProfileEnabled

boolean getProfileEnabled()
Get whether the task profiling is enabled.

Returns:
true if some tasks will be profiled

getProfileParams

java.lang.String getProfileParams()
Returns:
the parameters to pass to the task child to configure profiling

getUser

java.lang.String getUser()
Get the reported username for this job.

Returns:
the username

getSymlink

boolean getSymlink()
This method checks to see if symlinks are to be create for the localized cache files in the current working directory

Returns:
true if symlinks are to be created- else return false

getArchiveClassPaths

org.apache.hadoop.fs.Path[] getArchiveClassPaths()
Get the archive entries in classpath as an array of Path


getCacheArchives

java.net.URI[] getCacheArchives()
                                throws java.io.IOException
Get cache archives set in the Configuration

Returns:
A URI array of the caches set in the Configuration
Throws:
java.io.IOException

getCacheFiles

java.net.URI[] getCacheFiles()
                             throws java.io.IOException
Get cache files set in the Configuration

Throws:
java.io.IOException

getLocalCacheArchives

org.apache.hadoop.fs.Path[] getLocalCacheArchives()
                                                  throws java.io.IOException
Return the path array of the localized caches

Returns:
A path array of localized caches
Throws:
java.io.IOException

getLocalCacheFiles

org.apache.hadoop.fs.Path[] getLocalCacheFiles()
                                               throws java.io.IOException
Return the path array of the localized files

Returns:
A path array of localized files
Throws:
java.io.IOException

getFileClassPaths

org.apache.hadoop.fs.Path[] getFileClassPaths()
Get the file entries in classpath as an array of Path


getArchiveTimestamps

java.lang.String[] getArchiveTimestamps()
Get the timestamps of the archives. Used by internal

Returns:
a string array of timestamps
Throws:
java.io.IOException

getFileTimestamps

java.lang.String[] getFileTimestamps()
Get the timestamps of the files. Used by internal

Returns:
a string array of timestamps
Throws:
java.io.IOException

getMaxMapAttempts

int getMaxMapAttempts()
Get the configured number of maximum attempts that will be made to run a

Returns:
the max number of attempts per map task.

getMaxReduceAttempts

int getMaxReduceAttempts()
Get the configured number of maximum attempts that will be made to run a

Returns:
the max number of attempts per reduce task.


Copyright © 2009 The Apache Software Foundation