|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.util.CompoundBloomFilterBase
org.apache.hadoop.hbase.util.CompoundBloomFilterWriter
@InterfaceAudience.Private public class CompoundBloomFilterWriter
Adds methods required for writing a compound Bloom filter to the data
section of an HFile to the
CompoundBloomFilter class.
| Field Summary | |
|---|---|
protected static org.apache.commons.logging.Log |
LOG
|
| Fields inherited from class org.apache.hadoop.hbase.util.CompoundBloomFilterBase |
|---|
comparator, errorRate, hashType, numChunks, totalByteSize, totalKeyCount, totalMaxKeys, VERSION |
| Constructor Summary | |
|---|---|
CompoundBloomFilterWriter(int chunkByteSizeHint,
float errorRate,
int hashType,
int maxFold,
boolean cacheOnWrite,
org.apache.hadoop.io.RawComparator<byte[]> comparator)
|
|
| Method Summary | |
|---|---|
void |
add(byte[] bloomKey,
int keyOffset,
int keyLength)
Adds a Bloom filter key. |
void |
allocBloom()
Allocate memory for the bloom filter data. |
void |
blockWritten(long offset,
int onDiskSize,
int uncompressedSize)
Called after a block has been written, and its offset, raw size, and compressed size have been determined. |
void |
compactBloom()
Compact the Bloom filter before writing metadata & data to disk. |
boolean |
getCacheOnWrite()
|
org.apache.hadoop.io.Writable |
getDataWriter()
Get a writable interface into bloom filter data (the actual Bloom bits). |
BlockType |
getInlineBlockType()
The type of blocks this block writer produces. |
org.apache.hadoop.io.Writable |
getMetaWriter()
Get a writable interface into bloom filter meta data. |
boolean |
shouldWriteBlock(boolean closing)
Determines whether there is a new block to be written out. |
void |
writeInlineBlock(DataOutput out)
Writes the block to the provided stream. |
| Methods inherited from class org.apache.hadoop.hbase.util.CompoundBloomFilterBase |
|---|
createBloomKey, getByteSize, getComparator, getKeyCount, getMaxKeys |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.hadoop.hbase.util.BloomFilterBase |
|---|
createBloomKey, getByteSize, getComparator, getKeyCount, getMaxKeys |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
public CompoundBloomFilterWriter(int chunkByteSizeHint,
float errorRate,
int hashType,
int maxFold,
boolean cacheOnWrite,
org.apache.hadoop.io.RawComparator<byte[]> comparator)
chunkByteSizeHint - each chunk's size in bytes. The real chunk size might be different
as required by the fold factor.errorRate - target false positive ratehashType - hash function type to usemaxFold - maximum degree of folding allowed| Method Detail |
|---|
public boolean shouldWriteBlock(boolean closing)
InlineBlockWriter
shouldWriteBlock in interface InlineBlockWriterclosing - whether the file is being closed, in which case we need to write
out all available data and not wait to accumulate another block
public void add(byte[] bloomKey,
int keyOffset,
int keyLength)
StoreFile.Writer.append(
org.apache.hadoop.hbase.KeyValue) for the details of deduplication.
add in interface BloomFilterWriterbloomKey - data to be added to the bloomkeyOffset - offset into the data to be addedkeyLength - length of the data to be added
public void writeInlineBlock(DataOutput out)
throws IOException
InlineBlockWriterInlineBlockWriter.shouldWriteBlock(boolean) returned true.
writeInlineBlock in interface InlineBlockWriterout - a stream (usually a compressing stream) to write the block to
IOException
public void blockWritten(long offset,
int onDiskSize,
int uncompressedSize)
InlineBlockWriter
blockWritten in interface InlineBlockWriteroffset - the offset of the block in the streamonDiskSize - the on-disk size of the blockuncompressedSize - the uncompressed size of the blockpublic BlockType getInlineBlockType()
InlineBlockWriter
getInlineBlockType in interface InlineBlockWriterpublic org.apache.hadoop.io.Writable getMetaWriter()
BloomFilterWriter
getMetaWriter in interface BloomFilterWriterpublic void compactBloom()
BloomFilterWriter
compactBloom in interface BloomFilterWriterpublic void allocBloom()
BloomFilterWriter
allocBloom in interface BloomFilterWriterpublic org.apache.hadoop.io.Writable getDataWriter()
BloomFilterWriter
getDataWriter in interface BloomFilterWriterpublic boolean getCacheOnWrite()
getCacheOnWrite in interface InlineBlockWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||