org.apache.hadoop.io
Class BloomMapFile.Reader

java.lang.Object
  extended by org.apache.hadoop.io.MapFile.Reader
      extended by org.apache.hadoop.io.BloomMapFile.Reader
All Implemented Interfaces:
Closeable
Enclosing class:
BloomMapFile

public static class BloomMapFile.Reader
extends MapFile.Reader


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.io.MapFile.Reader
MapFile.Reader.Option
 
Constructor Summary
BloomMapFile.Reader(FileSystem fs, String dirName, Configuration conf)
          Deprecated. 
BloomMapFile.Reader(FileSystem fs, String dirName, WritableComparator comparator, Configuration conf)
          Deprecated. 
BloomMapFile.Reader(FileSystem fs, String dirName, WritableComparator comparator, Configuration conf, boolean open)
          Deprecated. 
BloomMapFile.Reader(Path dir, Configuration conf, SequenceFile.Reader.Option... options)
           
 
Method Summary
 Writable get(WritableComparable key, Writable val)
          Fast version of the MapFile.Reader.get(WritableComparable, Writable) method.
 org.apache.hadoop.util.bloom.Filter getBloomFilter()
          Retrieve the Bloom filter used by this instance of the Reader.
 boolean probablyHasKey(WritableComparable key)
          Checks if this MapFile has the indicated key.
 
Methods inherited from class org.apache.hadoop.io.MapFile.Reader
close, comparator, createDataFileReader, finalKey, getClosest, getClosest, getKeyClass, getValueClass, midKey, next, open, reset, seek
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BloomMapFile.Reader

public BloomMapFile.Reader(Path dir,
                           Configuration conf,
                           SequenceFile.Reader.Option... options)
                    throws IOException
Throws:
IOException

BloomMapFile.Reader

@Deprecated
public BloomMapFile.Reader(FileSystem fs,
                                      String dirName,
                                      Configuration conf)
                    throws IOException
Deprecated. 

Throws:
IOException

BloomMapFile.Reader

@Deprecated
public BloomMapFile.Reader(FileSystem fs,
                                      String dirName,
                                      WritableComparator comparator,
                                      Configuration conf,
                                      boolean open)
                    throws IOException
Deprecated. 

Throws:
IOException

BloomMapFile.Reader

@Deprecated
public BloomMapFile.Reader(FileSystem fs,
                                      String dirName,
                                      WritableComparator comparator,
                                      Configuration conf)
                    throws IOException
Deprecated. 

Throws:
IOException
Method Detail

probablyHasKey

public boolean probablyHasKey(WritableComparable key)
                       throws IOException
Checks if this MapFile has the indicated key. The membership test is performed using a Bloom filter, so the result has always non-zero probability of false positives.

Parameters:
key - key to check
Returns:
false iff key doesn't exist, true if key probably exists.
Throws:
IOException

get

public Writable get(WritableComparable key,
                    Writable val)
             throws IOException
Fast version of the MapFile.Reader.get(WritableComparable, Writable) method. First it checks the Bloom filter for the existence of the key, and only if present it performs the real get operation. This yields significant performance improvements for get operations on sparsely populated files.

Overrides:
get in class MapFile.Reader
Throws:
IOException

getBloomFilter

public org.apache.hadoop.util.bloom.Filter getBloomFilter()
Retrieve the Bloom filter used by this instance of the Reader.

Returns:
a Bloom filter (see Filter)


Copyright © 2013 Apache Software Foundation. All Rights Reserved.