@InterfaceAudience.Private public class PreviousBlockCompressionRatePredicator extends Object implements BlockCompressedSizePredicator
BLOCK_COMPRESSED_SIZE_PREDICATOR, MAX_BLOCK_SIZE_UNCOMPRESSED| Constructor and Description |
|---|
PreviousBlockCompressionRatePredicator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldFinishBlock(int uncompressed)
Returns true if the passed uncompressed size is larger than the limit calculated by
updateLatestBlockSizes. |
void |
updateLatestBlockSizes(HFileContext context,
int uncompressed,
int compressed)
Recalculates compression rate for the last block and adjusts the block size limit as:
BLOCK_SIZE * (uncompressed/compressed).
|
public PreviousBlockCompressionRatePredicator()
public void updateLatestBlockSizes(HFileContext context, int uncompressed, int compressed)
updateLatestBlockSizes in interface BlockCompressedSizePredicatorcontext - HFIleContext containing the configured max block size.uncompressed - the uncompressed size of last block written.compressed - the compressed size of last block written.public boolean shouldFinishBlock(int uncompressed)
updateLatestBlockSizes.shouldFinishBlock in interface BlockCompressedSizePredicatoruncompressed - true if the block should be finished.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.