org.apache.hadoop.mapreduce.lib.input
Class SequenceFileInputFilter.RegexFilter

java.lang.Object
  extended by org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFilter.FilterBase
      extended by org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFilter.RegexFilter
All Implemented Interfaces:
Configurable, SequenceFileInputFilter.Filter
Enclosing class:
SequenceFileInputFilter<K,V>

public static class SequenceFileInputFilter.RegexFilter
extends SequenceFileInputFilter.FilterBase

Records filter by matching key to regex


Constructor Summary
SequenceFileInputFilter.RegexFilter()
           
 
Method Summary
 boolean accept(Object key)
          Filtering method If key matches the regex, return true; otherwise return false
 void setConf(Configuration conf)
          configure the Filter by checking the configuration
static void setPattern(Configuration conf, String regex)
          Define the filtering regex and stores it in conf
 
Methods inherited from class org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFilter.FilterBase
getConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceFileInputFilter.RegexFilter

public SequenceFileInputFilter.RegexFilter()
Method Detail

setPattern

public static void setPattern(Configuration conf,
                              String regex)
                       throws PatternSyntaxException
Define the filtering regex and stores it in conf

Parameters:
conf - where the regex is set
regex - regex used as a filter
Throws:
PatternSyntaxException

setConf

public void setConf(Configuration conf)
configure the Filter by checking the configuration


accept

public boolean accept(Object key)
Filtering method If key matches the regex, return true; otherwise return false

Parameters:
key - record key
Returns:
true if a record is accepted; return false otherwise
See Also:
SequenceFileInputFilter.Filter.accept(Object)


Copyright © 2009 The Apache Software Foundation