Package org.apache.hadoop.mapred
Interface Reporter
- All Superinterfaces:
Progressable
A facility for Map-Reduce applications to report progress and update
counters, status information etc.
Mapper and Reducer can use the Reporter
provided to report progress or just indicate that they are alive. In
scenarios where the application takes significant amount of time to
process individual key/value pairs, this is crucial since the framework
might assume that the task has timed-out and kill that task.
Applications can also update Counters via the provided
Reporter .
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetCounter(Enum<?> name) Get theCounters.Counterof the given group with the given name.getCounter(String group, String name) Get theCounters.Counterof the given group with the given name.Get theInputSplitobject for a map.floatGet the progress of the task.voidincrCounter(Enum<?> key, long amount) Increments the counter identified by the key, which can be of anyEnumtype, by the specified amount.voidincrCounter(String group, String counter, long amount) Increments the counter identified by the group and counter name by the specified amount.voidSet the status description for the task.Methods inherited from interface org.apache.hadoop.util.Progressable
progress
-
Field Details
-
NULL
A constant of Reporter type that does nothing.
-
-
Method Details
-
setStatus
Set the status description for the task.- Parameters:
status- brief description of the current status.
-
getCounter
Get theCounters.Counterof the given group with the given name.- Parameters:
name- counter name- Returns:
- the
Counterof the given group/name.
-
getCounter
Get theCounters.Counterof the given group with the given name.- Parameters:
group- counter groupname- counter name- Returns:
- the
Counterof the given group/name.
-
incrCounter
Increments the counter identified by the key, which can be of anyEnumtype, by the specified amount.- Parameters:
key- key to identify the counter to be incremented. The key can be be anyEnum.amount- A non-negative amount by which the counter is to be incremented.
-
incrCounter
Increments the counter identified by the group and counter name by the specified amount.- Parameters:
group- name to identify the group of the counter to be incremented.counter- name to identify the counter within the group.amount- A non-negative amount by which the counter is to be incremented.
-
getInputSplit
Get theInputSplitobject for a map.- Returns:
- the
InputSplitthat the map is reading from. - Throws:
UnsupportedOperationException- if called outside a mapper
-
getProgress
float getProgress()Get the progress of the task. Progress is represented as a number between 0 and 1 (inclusive).
-