org.apache.hadoop.mapreduce.lib.map

## Class RegexMapper<K>

- java.lang.Object
- - org.apache.hadoop.mapreduce.Mapper<K,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable>
  - - org.apache.hadoop.mapreduce.lib.map.RegexMapper<K>

-     @InterfaceAudience.Public
       @InterfaceStability.Stable
      public class RegexMapper<K>
      extends Mapper<K,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable>

  A `Mapper` that extracts text matching a regular expression.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper

      `Mapper.Context`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `GROUP`
    `static String` | `PATTERN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegexMapper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `map(K key, org.apache.hadoop.io.Text value, Mapper.Context context)` Called once for each key/value pair in the input split.
    `void` | `setup(Mapper.Context context)` Called once at the beginning of the task.

    - ### Methods inherited from class org.apache.hadoop.mapreduce.Mapper

      `cleanup, run`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PATTERN

          public static String PATTERN

    - #### GROUP

          public static String GROUP

  - ### Constructor Detail

    - #### RegexMapper

          public RegexMapper()

  - ### Method Detail

    - #### setup

          public void setup(Mapper.Context context)

      Description copied from class: `Mapper`
      Called once at the beginning of the task.
      Overrides:
        `setup` in class `Mapper<K,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable>`

    - #### map

          public void map(K key,
                          org.apache.hadoop.io.Text value,
                          Mapper.Context context)
                   throws IOException,
                          InterruptedException

      Description copied from class: `Mapper`
      Called once for each key/value pair in the input split. Most applications should override this, but the default is the identity function.
      Overrides:
        `map` in class `Mapper<K,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable>`
      Throws:
        `IOException`
        `InterruptedException`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.