SequenceFileInputFilter.PercentFilter (Hadoop 0.20.2-cdh3u3 API)
Date: 2012-03-20

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.mapred
Class SequenceFileInputFilter.PercentFilter

    java.lang.Object
      org.apache.hadoop.mapred.SequenceFileInputFilter.FilterBase
          org.apache.hadoop.mapred.SequenceFileInputFilter.PercentFilter

All Implemented Interfaces:
  Configurable, SequenceFileInputFilter.Filter

Enclosing class:
  SequenceFileInputFilter<K,V>

    public static class SequenceFileInputFilter.PercentFilter

extends SequenceFileInputFilter.FilterBase

This class returns a percentage of records The percentage is determined by a filtering frequency f using the criteria record# % f == 0. For example, if the frequency is 10, one out of 10 records is returned.

Constructor Summary
`SequenceFileInputFilter.PercentFilter()`

Method Summary
`boolean` | `accept(Object key)` Filtering method If record# % frequency==0, return true; otherwise return false
`void` | `setConf(Configuration conf)` configure the filter by checking the configuration
`static void` | `setFrequency(Configuration conf, int frequency)` set the frequency and stores it in conf

Methods inherited from class org.apache.hadoop.mapred.SequenceFileInputFilter.FilterBase
`getConf`

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

Constructor Detail

### SequenceFileInputFilter.PercentFilter

    public SequenceFileInputFilter.PercentFilter()

Method Detail

### setFrequency

    public static void setFrequency(Configuration conf,
                                    int frequency)

  set the frequency and stores it in conf

  Parameters:
    `conf` - configuration
    `frequency` - filtering frequencey

### setConf

    public void setConf(Configuration conf)

  configure the filter by checking the configuration

  Parameters:
    `conf` - configuration

### accept

    public boolean accept(Object key)

  Filtering method If record# % frequency==0, 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)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation