## org.apache.hadoop.contrib.utils.join
Class JobBase

    java.lang.Object
      org.apache.hadoop.contrib.utils.join.JobBase

All Implemented Interfaces:
  Closeable, JobConfigurable, Mapper, Reducer

Direct Known Subclasses:
  DataJoinMapperBase, DataJoinReducerBase

    public abstract class JobBase

extends Object
implements Mapper, Reducer

A common base implementing some statics collecting mechanisms that are commonly used in a typical map/reduce job.

Field Summary
`static org.apache.commons.logging.Log` `LOG`

Constructor Summary
`JobBase()`

Method Summary
`protected Double` `addDoubleValue(Object name, double inc)` Increment the given counter by the given incremental value If the counter does not exist, one is created with value 0.
`protected Long` `addLongValue(Object name, long inc)` Increment the given counter by the given incremental value If the counter does not exist, one is created with value 0.
`void` `configure(JobConf job)` Initializes a new instance from a `JobConf`.
`protected Double` `getDoubleValue(Object name)`
`protected Long` `getLongValue(Object name)`
`protected String` `getReport()` log the counters
`protected void` `report()` log the counters
`protected void` `setDoubleValue(Object name, double value)` Set the given counter to the given value
`protected void` `setLongValue(Object name, long value)` Set the given counter to the given value

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.apache.hadoop.mapred.Mapper
`map`

Methods inherited from interface org.apache.hadoop.mapred.Reducer
`reduce`

Methods inherited from interface java.io.Closeable
`close`

Field Detail

### LOG

    public static final org.apache.commons.logging.Log LOG

Constructor Detail

### JobBase

    public JobBase()

Method Detail

### setLongValue

    protected void setLongValue(Object name,
                                long value)

  Set the given counter to the given value

  Parameters:
    `name` - the counter name
    `value` - the value for the counter

### setDoubleValue

    protected void setDoubleValue(Object name,
                                  double value)

  Set the given counter to the given value

  Parameters:
    `name` - the counter name
    `value` - the value for the counter

### getLongValue

    protected Long getLongValue(Object name)

  Parameters:
    `name` - the counter name
  Returns:
    return the value of the given counter.

### getDoubleValue

    protected Double getDoubleValue(Object name)

  Parameters:
    `name` - the counter name
  Returns:
    return the value of the given counter.

### addLongValue

    protected Long addLongValue(Object name,
                                long inc)

  Increment the given counter by the given incremental value If the counter does not exist, one is created with value 0.

  Parameters:
    `name` - the counter name
    `inc` - the incremental value
  Returns:
    the updated value.

### addDoubleValue

    protected Double addDoubleValue(Object name,
                                    double inc)

  Increment the given counter by the given incremental value If the counter does not exist, one is created with value 0.

  Parameters:
    `name` - the counter name
    `inc` - the incremental value
  Returns:
    the updated value.

### report

    protected void report()

  log the counters

### getReport

    protected String getReport()

  log the counters

### configure

    public void configure(JobConf job)

  Initializes a new instance from a `JobConf`.

  Specified by:
    `configure` in interface `JobConfigurable`
  Parameters:
    `job` - the configuration

Copyright © 2009 The Apache Software Foundation