|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.metrics.SchemaConfigured
org.apache.hadoop.hbase.io.hfile.HFileBlock
public class HFileBlock
Reading HFile
version 1 and 2 blocks, and writing version 2 blocks.
HFile
's compression algorithm, with a type-specific
magic record stored in the beginning of the compressed data (i.e. one needs
to uncompress the compressed block to determine the block type). There is
only a single compression algorithm setting for all blocks. Offset and size
information from the block index are required to read a block.
HFile
,
similarly to what was done in version 1.
Nested Class Summary | |
---|---|
static interface |
HFileBlock.BlockIterator
An interface allowing to iterate HFileBlock s. |
static interface |
HFileBlock.BlockWritable
Something that can be written into a block. |
static interface |
HFileBlock.FSReader
A full-fledged reader with iteration ability. |
static class |
HFileBlock.Writer
Unified version 2 HFile block writer. |
Field Summary | |
---|---|
static int |
BYTE_BUFFER_HEAP_SIZE
|
static boolean |
DONT_FILL_HEADER
|
static int |
ENCODED_HEADER_SIZE
The size of block header when blockType is BlockType.ENCODED_DATA . |
static boolean |
FILL_HEADER
|
Fields inherited from class org.apache.hadoop.hbase.regionserver.metrics.SchemaConfigured |
---|
SCHEMA_CONFIGURED_UNALIGNED_HEAP_SIZE |
Method Summary | |
---|---|
void |
assumeUncompressed()
An additional sanity-check in case no compression is being used. |
boolean |
doesIncludeMemstoreTS()
|
boolean |
equals(Object comparison)
|
void |
expectType(BlockType expectedType)
|
BlockType |
getBlockType()
|
ByteBuffer |
getBufferReadOnly()
Returns the buffer this block stores internally. |
DataInputStream |
getByteStream()
|
DataBlockEncoding |
getDataBlockEncoding()
|
short |
getDataBlockEncodingId()
|
CacheableDeserializer<Cacheable> |
getDeserializer()
Returns CacheableDeserializer instance which reconstructs original object from ByteBuffer. |
byte[] |
getDummyHeaderForVersion()
Return the appropriate DUMMY_HEADER for the minor version |
int |
getNextBlockOnDiskSizeWithHeader()
|
long |
getOffset()
|
int |
getOnDiskSizeWithHeader()
|
long |
getPrevBlockOffset()
|
int |
getSerializedLength()
Returns the length of the ByteBuffer required to serialized the object. |
int |
getUncompressedSizeWithoutHeader()
|
int |
headerSize()
Returns the size of this block header. |
long |
heapSize()
|
static boolean |
readWithExtra(InputStream in,
byte[] buf,
int bufOffset,
int necessaryLen,
int extraLen)
Read from an input stream. |
void |
serialize(ByteBuffer destination)
Serializes its data into destination. |
String |
toString()
|
Methods inherited from class org.apache.hadoop.hbase.regionserver.metrics.SchemaConfigured |
---|
createUnknown, getColumnFamilyName, getSchemaMetrics, getTableName, isSchemaConfigured, passSchemaMetricsTo, resetSchemaMetricsConf, schemaConfAsJSON, schemaConfigurationChanged |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.hbase.io.hfile.Cacheable |
---|
getSchemaMetrics |
Field Detail |
---|
public static final boolean FILL_HEADER
public static final boolean DONT_FILL_HEADER
public static final int ENCODED_HEADER_SIZE
BlockType.ENCODED_DATA
.
This extends normal header by adding the id of encoder.
public static final int BYTE_BUFFER_HEAP_SIZE
Method Detail |
---|
public BlockType getBlockType()
getBlockType
in interface Cacheable
public short getDataBlockEncodingId()
public int getOnDiskSizeWithHeader()
public int getUncompressedSizeWithoutHeader()
public long getPrevBlockOffset()
public ByteBuffer getBufferReadOnly()
CompoundBloomFilter
to avoid object creation on every
Bloom filter lookup, but has to be used with caution. Checksum data
is not included in the returned buffer.
public String toString()
toString
in class Object
public void assumeUncompressed() throws IOException
IOException
public void expectType(BlockType expectedType) throws IOException
expectedType
- the expected type of this block
IOException
- if this block's type is different than expectedpublic long getOffset()
public DataInputStream getByteStream()
public long heapSize()
heapSize
in interface HeapSize
heapSize
in class SchemaConfigured
public static boolean readWithExtra(InputStream in, byte[] buf, int bufOffset, int necessaryLen, int extraLen) throws IOException
IOUtils.readFully(InputStream, byte[], int, int)
, but specifies a
number of "extra" bytes that would be desirable but not absolutely
necessary to read.
in
- the input stream to read frombuf
- the buffer to read intobufOffset
- the destination offset in the buffernecessaryLen
- the number of bytes that are absolutely necessary to
readextraLen
- the number of extra bytes that would be nice to read
IOException
- if failed to read the necessary bytespublic int getNextBlockOnDiskSizeWithHeader()
public int getSerializedLength()
Cacheable
getSerializedLength
in interface Cacheable
public void serialize(ByteBuffer destination)
Cacheable
serialize
in interface Cacheable
public CacheableDeserializer<Cacheable> getDeserializer()
Cacheable
getDeserializer
in interface Cacheable
public boolean equals(Object comparison)
equals
in class Object
public boolean doesIncludeMemstoreTS()
public DataBlockEncoding getDataBlockEncoding()
public int headerSize()
public byte[] getDummyHeaderForVersion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |