Class Compressor

java.lang.Object
org.apache.hadoop.hbase.regionserver.wal.Compressor

@Private public class Compressor extends Object
A set of static functions for running our custom WAL compression/decompression. Also contains a command line tool to compress and uncompress WALs.
  • Constructor Details

  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Command line tool to compress and uncompress WALs.
      Throws:
      IOException
    • printHelp

      private static void printHelp()
    • transformFile

      private static void transformFile(org.apache.hadoop.fs.Path input, org.apache.hadoop.fs.Path output) throws IOException
      Throws:
      IOException
    • readCompressed

      @Deprecated static byte[] readCompressed(DataInput in, Dictionary dict) throws IOException
      Deprecated.
      Reads the next compressed entry and returns it as a byte array
      Parameters:
      in - the DataInput to read from
      dict - the dictionary we use for our read.
      Returns:
      the uncompressed array.
      Throws:
      IOException
    • uncompressIntoArray

      @Deprecated static int uncompressIntoArray(byte[] to, int offset, DataInput in, Dictionary dict) throws IOException
      Deprecated.
      Reads a compressed entry into an array. The output into the array ends up length-prefixed.
      Parameters:
      to - the array to write into
      offset - array offset to start writing to
      in - the DataInput to read from
      dict - the dictionary to use for compression
      Returns:
      the length of the uncompressed data
      Throws:
      IOException
    • writeCompressed

      @Deprecated static void writeCompressed(byte[] data, int offset, int length, DataOutput out, Dictionary dict) throws IOException
      Deprecated.
      Compresses and writes an array to a DataOutput
      Parameters:
      data - the array to write.
      out - the DataOutput to write into
      dict - the dictionary to use for compression
      Throws:
      IOException
    • toShort

      static short toShort(byte hi, byte lo)