Enum DataBlockEncoding

java.lang.Object
java.lang.Enum<DataBlockEncoding>
org.apache.hadoop.hbase.io.encoding.DataBlockEncoding
All Implemented Interfaces:
Serializable, Comparable<DataBlockEncoding>

@Public public enum DataBlockEncoding extends Enum<DataBlockEncoding>
Provide access to all data block encoding algorithms. All of the algorithms are required to have unique id which should NEVER be changed. If you want to add a new algorithm/version, assign it a new id. Announce the new id in the HBase mailing list to prevent collisions.
  • Enum Constant Details

  • Field Details

  • Constructor Details

  • Method Details

    • values

      public static DataBlockEncoding[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DataBlockEncoding valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getNameInBytes

      public byte[] getNameInBytes()
      Returns name converted to bytes.
    • getId

      public short getId()
      Returns The id of a data block encoder.
    • writeIdInBytes

      public void writeIdInBytes(OutputStream stream) throws IOException
      Writes id in bytes.
      Parameters:
      stream - where the id should be written.
      Throws:
      IOException
    • writeIdInBytes

      public void writeIdInBytes(byte[] dest, int offset) throws IOException
      Writes id bytes to the given array starting from offset.
      Parameters:
      dest - output array
      offset - starting offset of the output array
      Throws:
      IOException
    • getEncoder

      Return new data block encoder for given algorithm type.
      Returns:
      data block encoder if algorithm is specified, null if none is selected.
    • getDataBlockEncoderById

      public static DataBlockEncoder getDataBlockEncoderById(short encoderId)
      Find and create data block encoder for given id;
      Parameters:
      encoderId - id of data block encoder.
      Returns:
      Newly created data block encoder.
    • getNameFromId

      public static String getNameFromId(short encoderId)
      Find and return the name of data block encoder for the given id.
      Parameters:
      encoderId - id of data block encoder
      Returns:
      name, same as used in options in column family
    • isCorrectEncoder

      public static boolean isCorrectEncoder(DataBlockEncoder encoder, short encoderId)
      Check if given encoder has this id.
      Parameters:
      encoder - encoder which id will be checked
      encoderId - id which we except
      Returns:
      true if id is right for given encoder, false otherwise
      Throws:
      IllegalArgumentException - thrown when there is no matching data block encoder
    • getEncodingById

      public static DataBlockEncoding getEncodingById(short dataBlockEncodingId)
    • createEncoder

      static DataBlockEncoder createEncoder(String fullyQualifiedClassName)