org.apache.hadoop.hbase.util
Interface BloomFilterWriter

All Superinterfaces:
BloomFilterBase
All Known Implementing Classes:
ByteBloomFilter, CompoundBloomFilterWriter

@InterfaceAudience.Private
public interface BloomFilterWriter
extends BloomFilterBase

Specifies methods needed to add elements to a Bloom filter and serialize the resulting Bloom filter as a sequence of bytes.


Method Summary
 void add(byte[] buf, int offset, int len)
          Add the specified binary to the bloom filter.
 void allocBloom()
          Allocate memory for the bloom filter data.
 void compactBloom()
          Compact the Bloom filter before writing metadata & data to disk.
 org.apache.hadoop.io.Writable getDataWriter()
          Get a writable interface into bloom filter data (the actual Bloom bits).
 org.apache.hadoop.io.Writable getMetaWriter()
          Get a writable interface into bloom filter meta data.
 
Methods inherited from interface org.apache.hadoop.hbase.util.BloomFilterBase
createBloomKey, getByteSize, getComparator, getKeyCount, getMaxKeys
 

Method Detail

allocBloom

void allocBloom()
Allocate memory for the bloom filter data.


compactBloom

void compactBloom()
Compact the Bloom filter before writing metadata & data to disk.


getMetaWriter

org.apache.hadoop.io.Writable getMetaWriter()
Get a writable interface into bloom filter meta data.

Returns:
a writable instance that can be later written to a stream

getDataWriter

org.apache.hadoop.io.Writable getDataWriter()
Get a writable interface into bloom filter data (the actual Bloom bits). Not used for compound Bloom filters.

Returns:
a writable instance that can be later written to a stream

add

void add(byte[] buf,
         int offset,
         int len)
Add the specified binary to the bloom filter.

Parameters:
buf - data to be added to the bloom
offset - offset into the data to be added
len - length of the data to be added


Copyright © 2015 The Apache Software Foundation. All rights reserved.