org.apache.hadoop.hbase.util
Enum ChecksumType

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

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 Summary
CRC32
           
CRC32C
           
NULL
           
 
Field Summary
protected  org.apache.commons.logging.Log LOG
           
 
Method Summary
static ChecksumType codeToType(byte b)
          Cannot rely on enum ordinals .
abstract  Checksum getChecksumObject()
          returns a object that can be used to generate/validate checksums
 byte getCode()
           
abstract  String getName()
          returns the name of this checksum type
static ChecksumType nameToType(String name)
          Map a checksum name to a specific type.
static ChecksumType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ChecksumType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NULL

public static final ChecksumType NULL

CRC32

public static final ChecksumType CRC32

CRC32C

public static final ChecksumType CRC32C
Field Detail

LOG

protected org.apache.commons.logging.Log LOG
Method Detail

values

public static ChecksumType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ChecksumType c : ChecksumType.values())
    System.out.println(c);

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

getName

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


getChecksumObject

public abstract Checksum getChecksumObject()
                                    throws IOException
returns a object that can be used to generate/validate checksums

Throws:
IOException

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.

Parameters:
b -
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.

Parameters:
name -
Returns:
Type associated with passed code.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.