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) | |
TransactionLogApplier & | operator= (const TransactionLogApplier &other) |
WriteBuffer * | getWriteBuffer (const drizzled::Session &session) |
Private Attributes | |
TransactionLog * | transaction_log |
TransactionLogIndex * | transaction_log_index |
uint32_t | num_write_buffers |
Number of write buffers used. | |
std::vector< WriteBuffer * > | write_buffers |
array of write buffers |
Definition at line 54 of file transaction_log_applier.h.
TransactionLogApplier::~TransactionLogApplier | ( | ) |
Destructor
Definition at line 82 of file transaction_log_applier.cc.
References transaction_log, and write_buffers.
plugin::ReplicationReturnCode TransactionLogApplier::apply | ( | drizzled::Session & | in_session, |
const drizzled::message::Transaction & | to_apply | ||
) | [virtual] |
Applies a Transaction to the serial log
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.
Session | descriptor |
Transaction | message 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
Session | descriptor |
Definition at line 92 of file transaction_log_applier.cc.
References drizzled::Session::getSessionId(), num_write_buffers, and write_buffers.
Referenced by apply().
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().