Drizzled Public API Documentation

TransactionLogApplier Class Reference

Inheritance diagram for TransactionLogApplier:
drizzled::plugin::TransactionApplier drizzled::plugin::Plugin

List of all members.

Public Types

typedef std::pair< const
std::string, const std::string > 
map_key
typedef std::map< const
map_key, plugin::Plugin * > 
map
typedef std::vector< Plugin * > vector

Public Member Functions

 TransactionLogApplier (const std::string name_arg, TransactionLog *in_transaction_log, TransactionLogIndex *in_transaction_log_index, uint32_t in_num_write_buffers)
 ~TransactionLogApplier ()
drizzled::plugin::ReplicationReturnCode apply (drizzled::Session &in_session, const drizzled::message::Transaction &to_apply)
virtual void shutdownPlugin ()
virtual void prime ()
virtual void startup (drizzled::Session &)
void activate ()
void deactivate ()
bool isActive () const
const std::string & getName () const
void setModule (module::Module *module)
const std::string & getTypeName () const
virtual bool removeLast () const
const std::string & getModuleName () const

Static Public Member Functions

static bool addPlugin (TransactionApplier *applier)
static void removePlugin (TransactionApplier *applier)

Private Member Functions

 TransactionLogApplier (const TransactionLogApplier &other)
TransactionLogApplieroperator= (const TransactionLogApplier &other)
WriteBuffergetWriteBuffer (const drizzled::Session &session)

Private Attributes

TransactionLogtransaction_log
TransactionLogIndextransaction_log_index
uint32_t num_write_buffers
 Number of write buffers used.
std::vector< WriteBuffer * > write_buffers
 array of write buffers

Detailed Description

Definition at line 54 of file transaction_log_applier.h.


Constructor & Destructor Documentation

TransactionLogApplier::~TransactionLogApplier ( )

Destructor

Definition at line 82 of file transaction_log_applier.cc.

References transaction_log, and write_buffers.


Member Function Documentation

plugin::ReplicationReturnCode TransactionLogApplier::apply ( drizzled::Session in_session,
const drizzled::message::Transaction to_apply 
) [virtual]

Applies a Transaction to the serial log

Note:

It is important to note that memory allocation for the supplied pointer is not guaranteed after the completion of this function -- meaning the caller can dispose of the supplied message. Therefore, appliers which are implementing an asynchronous replication system must copy the supplied message to their own controlled memory storage area.

Parameters:
Sessiondescriptor
Transactionmessage to be replicated

Implements drizzled::plugin::TransactionApplier.

Definition at line 98 of file transaction_log_applier.cc.

References TransactionLogIndex::addEntry(), TransactionLog::getLogEntrySize(), WriteBuffer::getRawBytes(), getWriteBuffer(), WriteBuffer::lock(), TransactionLog::packTransactionIntoLogEntry(), WriteBuffer::resize(), transaction_log, WriteBuffer::unlock(), and TransactionLog::writeEntry().

WriteBuffer * TransactionLogApplier::getWriteBuffer ( const drizzled::Session session) [private]

Returns the write buffer for the supplied session

Parameters:
Sessiondescriptor

Definition at line 92 of file transaction_log_applier.cc.

References drizzled::Session::getSessionId(), num_write_buffers, and write_buffers.

Referenced by apply().


Member Data Documentation

This Applier owns the memory of the associated TransactionLog and its index - so we have to track it.

Definition at line 93 of file transaction_log_applier.h.

Referenced by apply(), and ~TransactionLogApplier().


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