Package org.apache.hadoop.hdfs.protocol
Enum Class BlockType
- All Implemented Interfaces:
Serializable,Comparable<BlockType>,Constable
Type of a block. Previously, all blocks were replicated (contiguous).
Then Erasure Coded blocks (striped) were implemented.
BlockTypes are currently defined by the highest bit in the block id. If
this bit is set, then the block is striped.
Further extensions may claim the second bit s.t. the highest two bits are
set. e.g.
0b00 == contiguous
0b10 == striped
0b11 == possible further extension block type.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic BlockTypefromBlockId(long blockId) Parse a BlockId to find the BlockType Note: the old block id generation algorithm was based on a pseudo random number generator, so there may be legacy blocks that make this conversion unreliable.static BlockTypeReturns the enum constant of this class with the specified name.static BlockType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTIGUOUS
-
STRIPED
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
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.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromBlockId
Parse a BlockId to find the BlockType Note: the old block id generation algorithm was based on a pseudo random number generator, so there may be legacy blocks that make this conversion unreliable.
-