0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
Hypertable::BlockHeaderCellStore Class Reference

cell store block header. More...

#include <BlockHeaderCellStore.h>

Inheritance diagram for Hypertable::BlockHeaderCellStore:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::BlockHeaderCellStore:
Collaboration graph
[legend]

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
versionVersion of cell store block header
magicMagic string initializer.

Definition at line 46 of file BlockHeaderCellStore.cc.

Member Function Documentation

void BlockHeaderCellStore::decode ( const uint8_t **  bufp,
size_t *  remainp 
)
virtual

Decodes cell store block header from memory location.

See also
encode() for layout
Parameters
bufpAddress of pointer to beginning of serialized block header (advanced by call)
remainpAddress 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.

void BlockHeaderCellStore::encode ( uint8_t **  bufp)
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.

Parameters
bufpAddress of pointer to destination (advanced by call)

Reimplemented from Hypertable::BlockHeader.

Definition at line 56 of file BlockHeaderCellStore.cc.

size_t BlockHeaderCellStore::encoded_length ( )
virtual

Returns length of serizlized block header.

See also
encode() for layout
Returns
Length of serialized 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.

Returns
true if object is logically equal to other, false otherwise.

Definition at line 79 of file BlockHeaderCellStore.cc.

Member Data Documentation

const uint16_t BlockHeaderCellStore::LatestVersion = 1
static

Definition at line 51 of file BlockHeaderCellStore.h.

uint16_t Hypertable::BlockHeaderCellStore::m_version
private

Serialization format version number

Definition at line 99 of file BlockHeaderCellStore.h.


The documentation for this class was generated from the following files: