@InterfaceAudience.Private public class CompoundBloomFilterWriter extends CompoundBloomFilterBase implements BloomFilterWriter, InlineBlockWriter
HFile to the CompoundBloomFilter class.comparator, errorRate, hashType, numChunks, totalByteSize, totalKeyCount, totalMaxKeys, VERSION| Constructor and Description |
|---|
CompoundBloomFilterWriter(int chunkByteSizeHint,
float errorRate,
int hashType,
int maxFold,
boolean cacheOnWrite,
CellComparator comparator,
BloomType bloomType)
each chunk's size in bytes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(Cell cell)
Append the given cell
|
void |
beforeShipped()
The action that needs to be performed before
Shipper.shipped() is performed |
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()
Returns true if inline blocks produced by this writer should be cached
|
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.
|
Cell |
getPrevCell()
Returns the previous cell written by this writer
|
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.
|
getByteSize, getKeyCount, getMaxKeysclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetByteSize, getKeyCount, getMaxKeyspublic CompoundBloomFilterWriter(int chunkByteSizeHint,
float errorRate,
int hashType,
int maxFold,
boolean cacheOnWrite,
CellComparator comparator,
BloomType bloomType)
public boolean shouldWriteBlock(boolean closing)
InlineBlockWritershouldWriteBlock in interface InlineBlockWriterpublic void append(Cell cell) throws IOException
CellSinkappend in interface CellSinkcell - the cell to be addedIOExceptionpublic void beforeShipped()
throws IOException
ShipperListenerShipper.shipped() is performedbeforeShipped in interface ShipperListenerIOExceptionpublic Cell getPrevCell()
BloomFilterWritergetPrevCell in interface BloomFilterWriterpublic void writeInlineBlock(DataOutput out) throws IOException
InlineBlockWriterInlineBlockWriter.shouldWriteBlock(boolean) returned true. a stream (usually a compressing stream) to
write the block towriteInlineBlock in interface InlineBlockWriterIOExceptionpublic void blockWritten(long offset,
int onDiskSize,
int uncompressedSize)
InlineBlockWriterblockWritten 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()
InlineBlockWritergetInlineBlockType in interface InlineBlockWriterpublic void compactBloom()
BloomFilterWritercompactBloom in interface BloomFilterWriterpublic org.apache.hadoop.io.Writable getMetaWriter()
BloomFilterWritergetMetaWriter in interface BloomFilterWriterpublic org.apache.hadoop.io.Writable getDataWriter()
BloomFilterWritergetDataWriter in interface BloomFilterWriterpublic boolean getCacheOnWrite()
InlineBlockWritergetCacheOnWrite in interface InlineBlockWriterCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.