cell store block header. More...
#include <BlockHeaderCellStore.h>
Public Member Functions | |
BlockHeaderCellStore (uint16_t version=LatestVersion, const char *magic=0) | |
Constructor with version and magic string initializers. More... | |
virtual size_t | encoded_length () |
Returns length of serizlized block header. More... | |
virtual void | encode (uint8_t **bufp) |
Encodes cell store block header to memory location. More... | |
virtual void | decode (const uint8_t **bufp, size_t *remainp) |
Decodes cell store block header from memory location. More... | |
bool | equals (const BlockHeaderCellStore &other) const |
Equality test. More... | |
Public Member Functions inherited from Hypertable::BlockHeader | |
BlockHeader (uint16_t version=LatestVersion, const char *magic=0) | |
Constructor. More... | |
virtual | ~BlockHeader () |
Destructor. More... | |
void | set_magic (const char *magic) |
Sets the "magic" field. More... | |
const char * | get_magic () |
Gets a pointer to the "magic" field. More... | |
bool | check_magic (const char *magic) |
Compares a given character sequence with the magic field. More... | |
void | set_data_length (uint32_t length) |
Sets the uncompressed data length field. More... | |
uint32_t | get_data_length () |
Gets the uncompressed data length field. More... | |
void | set_data_zlength (uint32_t zlength) |
Sets the compressed data length field. More... | |
uint32_t | get_data_zlength () |
Gets the compressed data length field. More... | |
void | set_data_checksum (uint32_t checksum) |
Sets the checksum field. More... | |
uint32_t | get_data_checksum () |
Gets the checksum field. More... | |
void | set_compression_type (uint16_t type) |
Sets the compression type field. More... | |
uint16_t | get_compression_type () |
Gets the compression type field. More... | |
void | set_flags (uint16_t flags) |
Sets the flags field. More... | |
uint16_t | get_flags () |
Gets the flags field. More... | |
void | write_header_checksum (uint8_t *base) |
Computes and writes checksum field. More... | |
bool | equals (const BlockHeader &other) const |
Equality test. More... | |
Static Public Attributes | |
static const uint16_t | LatestVersion = 1 |
Static Public Attributes inherited from Hypertable::BlockHeader | |
static const uint16_t | LatestVersion = 1 |
Private Attributes | |
uint16_t | m_version |
Serialization format version number More... | |
Additional Inherited Members | |
Protected Attributes inherited from Hypertable::BlockHeader | |
char | m_magic [10] |
"Magic" string used to identify start of block header More... | |
uint16_t | m_flags |
Flags. More... | |
uint32_t | m_data_length |
Uncompressed length of the data stored within the block. More... | |
uint32_t | m_data_zlength |
Compressed length of the data stored within the block. More... | |
uint32_t | m_data_checksum |
Checksum of (possibly compressed) data stored within the block. More... | |
uint16_t | m_compression_type |
Type of data compression used (see BlockCompressionCodec::Type) More... | |
cell store block header.
This class represents a cell store block header in memory and provides methods for encoding and decoding the header to and from disk.
Definition at line 47 of file BlockHeaderCellStore.h.
BlockHeaderCellStore::BlockHeaderCellStore | ( | uint16_t | version = LatestVersion , |
const char * | magic = 0 |
||
) |
Constructor with version and magic string initializers.
Initializes m_version to to version
and passes magic
to the base class constructor.
version | Version of cell store block header |
magic | Magic string initializer. |
Definition at line 46 of file BlockHeaderCellStore.cc.
|
virtual |
Decodes cell store block header from memory location.
bufp | Address of pointer to beginning of serialized block header (advanced by call) |
remainp | Address of variable holding remaining valid data pointed to by bufp (decremented by call) |
Reimplemented from Hypertable::BlockHeader.
Definition at line 65 of file BlockHeaderCellStore.cc.
|
virtual |
Encodes cell store block header to memory location.
This method writes a serailized representation of the header to the memory location pointed to by *bufp
. It encodes the base portion of the header with a call to BlockHeader::encode(). Since there are no other additional fields in the cell store header, it doesn't need to encode anything more. It then calls BlockHeader::write_header_checksum() to compute and store the checksum. At the end of the call, *bufp
will point to the memory location immediately following the serialized header.
bufp | Address of pointer to destination (advanced by call) |
Reimplemented from Hypertable::BlockHeader.
Definition at line 56 of file BlockHeaderCellStore.cc.
|
virtual |
Returns length of serizlized block header.
Reimplemented from Hypertable::BlockHeader.
Definition at line 51 of file BlockHeaderCellStore.cc.
bool BlockHeaderCellStore::equals | ( | const BlockHeaderCellStore & | other | ) | const |
Equality test.
This method compares the members of the object to the members of other
, returning true if they're all equal.
other
, false otherwise. Definition at line 79 of file BlockHeaderCellStore.cc.
|
static |
Definition at line 51 of file BlockHeaderCellStore.h.
|
private |
Serialization format version number
Definition at line 99 of file BlockHeaderCellStore.h.