org.apache.hadoop.mapreduce.lib.reduce
Class WrappedReducer.Context

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer.Context
      extended by org.apache.hadoop.mapreduce.lib.reduce.WrappedReducer.Context
All Implemented Interfaces:
JobContext, ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>, TaskAttemptContext, TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>, org.apache.hadoop.util.Progressable
Enclosing class:
WrappedReducer<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

public class WrappedReducer.Context
extends Reducer.Context


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.mapreduce.ReduceContext
ReduceContext.ValueIterator<VALUEIN>
 
Field Summary
protected  ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> reduceContext
           
 
Fields inherited from interface org.apache.hadoop.mapreduce.JobContext
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 Summary
WrappedReducer.Context(ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> reduceContext)
           
 
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.
 Counter getCounter(java.lang.Enum counterName)
          Get the Counter for the given counterName.
 Counter getCounter(java.lang.String groupName, java.lang.String counterName)
          Get the Counter for the given groupName and counterName.
 org.apache.hadoop.security.Credentials getCredentials()
          Get credentials for the job.
 KEYIN getCurrentKey()
          Get the current key.
 VALUEIN getCurrentValue()
          Get the current value.
 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.
 OutputCommitter getOutputCommitter()
          Get the OutputCommitter for the task-attempt.
 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.
 java.lang.String getStatus()
          Get the last set status message.
 boolean getSymlink()
          This method checks to see if symlinks are to be create for the localized cache files in the current working directory
 TaskAttemptID getTaskAttemptID()
          Get the unique name for this task attempt.
 java.lang.String getUser()
          Get the reported username for this job.
 java.lang.Iterable<VALUEIN> getValues()
          Iterate through the values for the current key, reusing the same value object, which is stored in the context.
 org.apache.hadoop.fs.Path getWorkingDirectory()
          Get the current working directory for the default file system.
 boolean nextKey()
          Start processing next unique key.
 boolean nextKeyValue()
          Advance to the next key, value pair, returning null if at end.
 void progress()
           
 void setStatus(java.lang.String msg)
          Set the current status of the task to the given string.
 boolean userClassesTakesPrecedence()
          Get the boolean value for the property that specifies which classpath takes precedence when tasks are launched.
 void write(KEYOUT key, VALUEOUT value)
          Generate an output key/value pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reduceContext

protected ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> reduceContext
Constructor Detail

WrappedReducer.Context

public WrappedReducer.Context(ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> reduceContext)
Method Detail

getCurrentKey

public KEYIN getCurrentKey()
                    throws java.io.IOException,
                           java.lang.InterruptedException
Description copied from interface: TaskInputOutputContext
Get the current key.

Returns:
the current key object or null if there isn't one
Throws:
java.io.IOException
java.lang.InterruptedException

getCurrentValue

public VALUEIN getCurrentValue()
                        throws java.io.IOException,
                               java.lang.InterruptedException
Description copied from interface: TaskInputOutputContext
Get the current value.

Returns:
the value object that was read into
Throws:
java.io.IOException
java.lang.InterruptedException

nextKeyValue

public boolean nextKeyValue()
                     throws java.io.IOException,
                            java.lang.InterruptedException
Description copied from interface: TaskInputOutputContext
Advance to the next key, value pair, returning null if at end.

Returns:
the key object that was read into, or null if no more
Throws:
java.io.IOException
java.lang.InterruptedException

getCounter

public Counter getCounter(java.lang.Enum counterName)
Description copied from interface: TaskAttemptContext
Get the Counter for the given counterName.

Parameters:
counterName - counter name
Returns:
the Counter for the given counterName

getCounter

public Counter getCounter(java.lang.String groupName,
                          java.lang.String counterName)
Description copied from interface: TaskAttemptContext
Get the Counter for the given groupName and counterName.

counterName - counter name
Returns:
the Counter for the given groupName and counterName

getOutputCommitter

public OutputCommitter getOutputCommitter()
Description copied from interface: TaskInputOutputContext
Get the OutputCommitter for the task-attempt.

Returns:
the OutputCommitter for the task-attempt

write

public void write(KEYOUT key,
                  VALUEOUT value)
           throws java.io.IOException,
                  java.lang.InterruptedException
Description copied from interface: TaskInputOutputContext
Generate an output key/value pair.

Throws:
java.io.IOException
java.lang.InterruptedException

getStatus

public java.lang.String getStatus()
Description copied from interface: TaskAttemptContext
Get the last set status message.

Returns:
the current status message

getTaskAttemptID

public TaskAttemptID getTaskAttemptID()
Description copied from interface: TaskAttemptContext
Get the unique name for this task attempt.


setStatus

public void setStatus(java.lang.String msg)
Description copied from interface: TaskAttemptContext
Set the current status of the task to the given string.


getArchiveClassPaths

public org.apache.hadoop.fs.Path[] getArchiveClassPaths()
Description copied from interface: JobContext
Get the archive entries in classpath as an array of Path


getArchiveTimestamps

public java.lang.String[] getArchiveTimestamps()
Description copied from interface: JobContext
Get the timestamps of the archives. Used by internal

Returns:
a string array of timestamps

getCacheArchives

public java.net.URI[] getCacheArchives()
                                throws java.io.IOException
Description copied from interface: JobContext
Get cache archives set in the Configuration

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

getCacheFiles

public java.net.URI[] getCacheFiles()
                             throws java.io.IOException
Description copied from interface: JobContext
Get cache files set in the Configuration

Throws:
java.io.IOException

getCombinerClass

public java.lang.Class<? extends Reducer<?,?,?,?>> getCombinerClass()
                                                             throws java.lang.ClassNotFoundException
Description copied from interface: JobContext
Get the combiner class for the job.

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

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Description copied from interface: JobContext
Return the configuration for the job.

Returns:
the shared configuration object

getFileClassPaths

public org.apache.hadoop.fs.Path[] getFileClassPaths()
Description copied from interface: JobContext
Get the file entries in classpath as an array of Path


getFileTimestamps

public java.lang.String[] getFileTimestamps()
Description copied from interface: JobContext
Get the timestamps of the files. Used by internal

Returns:
a string array of timestamps

getCombinerKeyGroupingComparator

public org.apache.hadoop.io.RawComparator<?> getCombinerKeyGroupingComparator()
Description copied from interface: JobContext
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

public org.apache.hadoop.io.RawComparator<?> getGroupingComparator()
Description copied from interface: JobContext
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., JobContext.getCombinerKeyGroupingComparator()

getInputFormatClass

public java.lang.Class<? extends InputFormat<?,?>> getInputFormatClass()
                                                                throws java.lang.ClassNotFoundException
Description copied from interface: JobContext
Get the InputFormat class for the job.

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

getJar

public java.lang.String getJar()
Description copied from interface: JobContext
Get the pathname of the job's jar.

Returns:
the pathname

getJobID

public JobID getJobID()
Description copied from interface: JobContext
Get the unique ID for the job.

Returns:
the object with the job id

getJobName

public java.lang.String getJobName()
Description copied from interface: JobContext
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

public boolean userClassesTakesPrecedence()
Description copied from interface: JobContext
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

getJobSetupCleanupNeeded

public boolean getJobSetupCleanupNeeded()
Description copied from interface: JobContext
Get whether job-setup and job-cleanup is needed for the job

Returns:
boolean

getLocalCacheArchives

public org.apache.hadoop.fs.Path[] getLocalCacheArchives()
                                                  throws java.io.IOException
Description copied from interface: JobContext
Return the path array of the localized caches

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

getLocalCacheFiles

public org.apache.hadoop.fs.Path[] getLocalCacheFiles()
                                               throws java.io.IOException
Description copied from interface: JobContext
Return the path array of the localized files

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

getMapOutputKeyClass

public java.lang.Class<?> getMapOutputKeyClass()
Description copied from interface: JobContext
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

public java.lang.Class<?> getMapOutputValueClass()
Description copied from interface: JobContext
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.

getMapperClass

public java.lang.Class<? extends Mapper<?,?,?,?>> getMapperClass()
                                                          throws java.lang.ClassNotFoundException
Description copied from interface: JobContext
Get the Mapper class for the job.

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

getMaxMapAttempts

public int getMaxMapAttempts()
Description copied from interface: JobContext
Get the configured number of maximum attempts that will be made to run a

Returns:
the max number of attempts per map task.

getMaxReduceAttempts

public int getMaxReduceAttempts()
Description copied from interface: JobContext
Get the configured number of maximum attempts that will be made to run a

Returns:
the max number of attempts per reduce task.

getNumReduceTasks

public int getNumReduceTasks()
Description copied from interface: JobContext
Get configured the number of reduce tasks for this job. Defaults to 1.

Returns:
the number of reduce tasks for this job.

getOutputFormatClass

public java.lang.Class<? extends OutputFormat<?,?>> getOutputFormatClass()
                                                                  throws java.lang.ClassNotFoundException
Description copied from interface: JobContext
Get the OutputFormat class for the job.

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

getOutputKeyClass

public java.lang.Class<?> getOutputKeyClass()
Description copied from interface: JobContext
Get the key class for the job output data.

Returns:
the key class for the job output data.

getOutputValueClass

public java.lang.Class<?> getOutputValueClass()
Description copied from interface: JobContext
Get the value class for job outputs.

Returns:
the value class for job outputs.

getPartitionerClass

public java.lang.Class<? extends Partitioner<?,?>> getPartitionerClass()
                                                                throws java.lang.ClassNotFoundException
Description copied from interface: JobContext
Get the Partitioner class for the job.

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

getReducerClass

public java.lang.Class<? extends Reducer<?,?,?,?>> getReducerClass()
                                                            throws java.lang.ClassNotFoundException
Description copied from interface: JobContext
Get the Reducer class for the job.

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

getSortComparator

public org.apache.hadoop.io.RawComparator<?> getSortComparator()
Description copied from interface: JobContext
Get the RawComparator comparator used to compare keys.

Returns:
the RawComparator comparator used to compare keys.

getSymlink

public boolean getSymlink()
Description copied from interface: JobContext
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

getWorkingDirectory

public org.apache.hadoop.fs.Path getWorkingDirectory()
                                              throws java.io.IOException
Description copied from interface: JobContext
Get the current working directory for the default file system.

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

progress

public void progress()

getValues

public java.lang.Iterable<VALUEIN> getValues()
                                      throws java.io.IOException,
                                             java.lang.InterruptedException
Description copied from interface: ReduceContext
Iterate through the values for the current key, reusing the same value object, which is stored in the context.

Returns:
the series of values associated with the current key. All of the objects returned directly and indirectly from this method are reused.
Throws:
java.io.IOException
java.lang.InterruptedException

nextKey

public boolean nextKey()
                throws java.io.IOException,
                       java.lang.InterruptedException
Description copied from interface: ReduceContext
Start processing next unique key.

Throws:
java.io.IOException
java.lang.InterruptedException

getProfileEnabled

public boolean getProfileEnabled()
Description copied from interface: JobContext
Get whether the task profiling is enabled.

Returns:
true if some tasks will be profiled

getProfileParams

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

getUser

public java.lang.String getUser()
Description copied from interface: JobContext
Get the reported username for this job.

Returns:
the username

getCredentials

public org.apache.hadoop.security.Credentials getCredentials()
Description copied from interface: JobContext
Get credentials for the job.

Returns:
credentials for the job


Copyright © 2009 The Apache Software Foundation