|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<BlockType>
org.apache.hadoop.hbase.io.hfile.BlockType
@InterfaceAudience.Private public enum BlockType
Various types of HFile blocks. Ordinal values of these enum constants must not be relied upon. The values in the enum appear in the order they appear in a version 2 HFile.
Nested Class Summary | |
---|---|
static class |
BlockType.BlockCategory
|
Enum Constant Summary | |
---|---|
BLOOM_CHUNK
Bloom filter block, version 2 |
|
DATA
Data block, both versions |
|
DELETE_FAMILY_BLOOM_META
Delete Family Bloom filter metadata, version 2 |
|
ENCODED_DATA
An encoded data block (e.g. |
|
FILE_INFO
File info, version 2 |
|
GENERAL_BLOOM_META
General Bloom filter metadata, version 2 |
|
INDEX_V1
Block index magic string in version 1 |
|
INTERMEDIATE_INDEX
Intermediate-level version 2 index in the non-data block section |
|
LEAF_INDEX
Version 2 leaf index block. |
|
META
Meta blocks |
|
ROOT_INDEX
Root index block, also used for the single-level meta index, version 2 |
|
TRAILER
Fixed file trailer, both versions (always just a magic string) |
Field Summary | |
---|---|
static int |
MAGIC_LENGTH
|
Method Summary | |
---|---|
BlockType.BlockCategory |
getCategory()
|
int |
getId()
Use this instead of Enum.ordinal() . |
boolean |
isData()
|
static BlockType |
parse(byte[] buf,
int offset,
int length)
|
int |
put(byte[] bytes,
int offset)
Put the magic record out to the specified byte array position. |
static BlockType |
read(ByteBuffer buf)
|
static BlockType |
read(DataInputStream in)
|
void |
readAndCheck(ByteBuffer in)
Reads a magic record of the length MAGIC_LENGTH from the given
byte buffer and expects it to match this block type. |
void |
readAndCheck(DataInputStream in)
Reads a magic record of the length MAGIC_LENGTH from the given
stream and expects it to match this block type. |
static BlockType |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static BlockType[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
void |
write(ByteBuffer buf)
|
void |
write(DataOutput out)
|
void |
writeToStream(OutputStream out)
|
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 |
---|
public static final BlockType DATA
public static final BlockType ENCODED_DATA
public static final BlockType LEAF_INDEX
public static final BlockType BLOOM_CHUNK
public static final BlockType META
public static final BlockType INTERMEDIATE_INDEX
public static final BlockType ROOT_INDEX
public static final BlockType FILE_INFO
public static final BlockType GENERAL_BLOOM_META
public static final BlockType DELETE_FAMILY_BLOOM_META
public static final BlockType TRAILER
public static final BlockType INDEX_V1
Field Detail |
---|
public static final int MAGIC_LENGTH
Method Detail |
---|
public static BlockType[] values()
for (BlockType c : BlockType.values()) System.out.println(c);
public static BlockType valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic int getId()
Enum.ordinal()
. They work exactly the same, except
DATA and ENCODED_DATA get the same id using this method (overridden for
ENCODED_DATA
).
public void writeToStream(OutputStream out) throws IOException
IOException
public void write(DataOutput out) throws IOException
IOException
public void write(ByteBuffer buf)
public BlockType.BlockCategory getCategory()
public static BlockType parse(byte[] buf, int offset, int length) throws IOException
IOException
public static BlockType read(DataInputStream in) throws IOException
IOException
public static BlockType read(ByteBuffer buf) throws IOException
IOException
public int put(byte[] bytes, int offset)
bytes
- the byte arrayoffset
- position in the array
public void readAndCheck(DataInputStream in) throws IOException
MAGIC_LENGTH
from the given
stream and expects it to match this block type.
IOException
public void readAndCheck(ByteBuffer in) throws IOException
MAGIC_LENGTH
from the given
byte buffer and expects it to match this block type.
IOException
public final boolean isData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |