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>
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.
Field Summary |
static java.lang.String |
GROUP
|
static java.lang.String |
PATTERN
|
Method Summary |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PATTERN
public static java.lang.String PATTERN
GROUP
public static java.lang.String GROUP
RegexMapper
public RegexMapper()
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 java.io.IOException,
java.lang.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:
java.io.IOException
java.lang.InterruptedException
Copyright © 2009 The Apache Software Foundation