SequenceFileInputFilter.PercentFilter (Hadoop 1.2.1 API)
Date: 2013-07-22

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.mapreduce.lib.input
Class SequenceFileInputFilter.PercentFilter

    java.lang.Object
      org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFilter.FilterBase
          org.apache.hadoop.mapreduce.lib.input.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.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.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