Class CompressionUtil
java.lang.Object
org.apache.hadoop.hbase.io.compress.CompressionUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
compressionOverhead
(int bufferSize) Most compression algorithms can be presented with pathological input that causes an expansion rather than a compression.static int
roundInt2
(int v) Round up to the next power of two, unless the value would become negative (ints are signed), in which case just return Integer.MAX_VALUE.
-
Constructor Details
-
CompressionUtil
private CompressionUtil()
-
-
Method Details
-
roundInt2
Round up to the next power of two, unless the value would become negative (ints are signed), in which case just return Integer.MAX_VALUE. -
compressionOverhead
Most compression algorithms can be presented with pathological input that causes an expansion rather than a compression. Hadoop's compression API requires that we calculate additional buffer space required for the worst case. There is a formula developed for gzip that applies as a ballpark to all LZ variants. It should be good enough for now and has been tested as such with a range of different inputs.
-