Enum Class ChecksumType

All Implemented Interfaces:
Serializable, Comparable<ChecksumType>, Constable

@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 class, in the order they are declared.
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ChecksumType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum class 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.
      Type associated with passed code.
    • nameToType

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