Class CompressionUtil

java.lang.Object
org.apache.hadoop.hbase.io.compress.CompressionUtil

@Private public final class CompressionUtil extends Object
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • roundInt2

      public 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.
    • compressionOverhead

      public static int compressionOverhead(int bufferSize)
      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.