@InterfaceAudience.Private public interface BlockCompressedSizePredicator
updateLatestBlockSizes
allows for updating uncompressed
and compressed size values, and is called during block finishing (when we finally apply
compression on the block data). Final block size predicate logic is implemented in
shouldFinishBlock
, which is called by the block writer once uncompressed size has
reached the configured BLOCK size, and additional checks should be applied to decide if the block
can be finished.Modifier and Type | Field and Description |
---|---|
static String |
BLOCK_COMPRESSED_SIZE_PREDICATOR |
static String |
MAX_BLOCK_SIZE_UNCOMPRESSED |
Modifier and Type | Method and Description |
---|---|
boolean |
shouldFinishBlock(int uncompressed)
Decides if the block should be finished based on the comparison of its uncompressed size
against an adjusted size based on a predicated compression factor.
|
void |
updateLatestBlockSizes(HFileContext context,
int uncompressed,
int compressed)
Updates the predicator with both compressed and uncompressed sizes of latest block written.
|
static final String BLOCK_COMPRESSED_SIZE_PREDICATOR
static final String MAX_BLOCK_SIZE_UNCOMPRESSED
void updateLatestBlockSizes(HFileContext context, int uncompressed, int compressed)
context
- the HFileContext containg the configured max block size.uncompressed
- the uncompressed size of last block written.compressed
- the compressed size of last block written.boolean shouldFinishBlock(int uncompressed)
uncompressed
- true if the block should be finished.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.