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

Accumulates phantom update data for a phantom range. More...

#include <FragmentData.h>

Collaboration diagram for Hypertable::FragmentData:
Collaboration graph
[legend]

Public Member Functions

 FragmentData ()
 Constructor. More...
 
virtual ~FragmentData ()
 Destructor. More...
 
void add (EventPtr &event)
 Adds an Event object representing a call to RangeServer::phantom_update(). More...
 
void clear ()
 Clears the state. More...
 
void merge (TableIdentifier &table, RangePtr &range, CommitLogPtr &log)
 Adds accumulated data to phantom range and its transfer log. More...
 

Private Attributes

vector< EventPtrm_data
 Vector of RangeServer::phantom_update() events. More...
 
int64_t m_memory_consumption {}
 Amount of memory accumulated (for memory tracking) More...
 

Detailed Description

Accumulates phantom update data for a phantom range.

The recovery of a range server involves the phantom loading of its ranges into new range servers and then replaying its commit log to reconstruct the in-memory state of each recovered range. This replaying of the commit log involves reading each commit log file fragment and sending the commits found within the fragment, to the range servers that hold the phantom ranges to which they apply, by calling RangeServer::phantom_update(). Once the commit log replay is complete, a transfer log will be created for each phantom range to contain this commit log data. This transfer log is associated with each phantom range so that once they get flipped live, any subsequent restart of the range server can reconstruct the in-memory state for the range by replaying the transfer log. This class really exists as just an optimization to avoid copying the data received via RangeServer::phantom_update(). It does this in the following two ways:

Definition at line 70 of file FragmentData.h.

Constructor & Destructor Documentation

Hypertable::FragmentData::FragmentData ( )
inline

Constructor.

Definition at line 75 of file FragmentData.h.

FragmentData::~FragmentData ( )
virtual

Destructor.

Subtracts m_memory_consumption from global memory tracker

Definition at line 38 of file FragmentData.cc.

Member Function Documentation

void FragmentData::add ( EventPtr event)

Adds an Event object representing a call to RangeServer::phantom_update().

Adds event to m_data and adds the amount of memory consumed by event to both the global memory tracker and m_memory_consumption.

Parameters
eventRangeServer::phantom_update() event

Definition at line 42 of file FragmentData.cc.

void FragmentData::clear ( )

Clears the state.

Clears the m_data vector, subtracts m_memory_consumption from global memory tracker, and then sets m_memory_consumption to 0.

Definition at line 50 of file FragmentData.cc.

void FragmentData::merge ( TableIdentifier table,
RangePtr range,
CommitLogPtr log 
)

Adds accumulated data to phantom range and its transfer log.

For each accumulated event object, decodes the data held within the object (see RangeServerProtocol::create_request_phantom_update() for encoding format) and adds the data to the phantom range range and also writes the data to the phantom range's transfer log log.

Parameters
tableTable identifier of phantom range
rangePointer to phantom range object
logPhantom range's transfer log
See also
RangeServerProtocol::create_request_phantom_update()

Definition at line 57 of file FragmentData.cc.

Member Data Documentation

vector<EventPtr> Hypertable::FragmentData::m_data
private

Vector of RangeServer::phantom_update() events.

Definition at line 112 of file FragmentData.h.

int64_t Hypertable::FragmentData::m_memory_consumption {}
private

Amount of memory accumulated (for memory tracking)

Definition at line 115 of file FragmentData.h.


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