Enum ChecksumType

java.lang.Object
java.lang.Enum<ChecksumType>
org.apache.hadoop.hbase.util.ChecksumType
All Implemented Interfaces:
Serializable, Comparable<ChecksumType>

@Private public enum ChecksumType extends Enum<ChecksumType>
Checksum types. The Checksum type is a one byte number that stores a representation of the checksum algorithm used to encode a hfile. The ordinal of these cannot change or else you risk breaking all existing HFiles out there.
  • Enum Constant Details

  • Field Details

    • code

      private final byte code
  • Constructor Details

  • Method Details

    • values

      public static ChecksumType[] 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 ChecksumType 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
    • getDefaultChecksumType

    • getName

      public abstract String getName()
      returns the name of this checksum type
    • getDataChecksumType

      public abstract org.apache.hadoop.util.DataChecksum.Type getDataChecksumType()
      Function to get corresponding DataChecksum.Type.
    • getCode

      public byte getCode()
    • codeToType

      public static ChecksumType codeToType(byte b)
      Cannot rely on enum ordinals . They change if item is removed or moved. Do our own codes.
      Returns:
      Type associated with passed code.
    • nameToType

      public static ChecksumType nameToType(String name)
      Map a checksum name to a specific type. Do our own names.
      Returns:
      Type associated with passed code.