Public Member Functions | |
bool | init () |
bool | process () |
void | shutdown () |
void | setSleepInterval (uint32_t seconds) |
uint32_t | getSleepInterval () |
void | setApplierState (const std::string &err_msg, bool status) |
void | run (void) |
void | markInErrorState () |
void | clearErrorState () |
const std::string & | getErrorMessage () |
bool | executeSQL (std::vector< std::string > &sql) |
Protected Attributes | |
drizzled::Session::shared_ptr | _session |
Private Types | |
typedef std::vector< uint64_t > | TrxIdList |
Private Member Functions | |
bool | getListOfCompletedTransactions (TrxIdList &list) |
bool | getMessage (drizzled::message::Transaction &transaction, std::string &commit_id, uint64_t trx_id, uint32_t segment_id) |
bool | convertToSQL (const drizzled::message::Transaction &transaction, std::vector< std::string > &aggregate_sql, std::vector< std::string > &segmented_sql) |
bool | executeSQLWithCommitId (std::vector< std::string > &sql, const std::string &commit_id) |
bool | deleteFromQueue (uint64_t trx_id) |
bool | isEndStatement (const drizzled::message::Statement &statement) |
Private Attributes | |
uint32_t | _check_interval |
Definition at line 38 of file queue_consumer.h.
bool slave::QueueConsumer::convertToSQL | ( | const drizzled::message::Transaction & | transaction, |
std::vector< std::string > & | aggregate_sql, | ||
std::vector< std::string > & | segmented_sql | ||
) | [private] |
Convert the given Transaction message into equivalent SQL.
[in] | transaction | Transaction protobuf message to convert. |
[in,out] | aggregate_sql | Buffer for total SQL for this transaction. |
[in,out] | segmented_sql | Buffer for carried over segmented statements. |
true | Success |
false | Failure |
Definition at line 208 of file queue_consumer.cc.
bool slave::QueueConsumer::deleteFromQueue | ( | uint64_t | trx_id | ) | [private] |
Remove messages for a given transaction from the queue.
trx_id | Transaction ID for the messages to remove. |
true | Success |
false | Failure |
Definition at line 370 of file queue_consumer.cc.
bool slave::SQLExecutor::executeSQL | ( | std::vector< std::string > & | sql | ) | [inherited] |
Execute a batch of SQL statements.
sql | Batch of SQL statements to execute. |
true | Success |
false | Failure |
Definition at line 49 of file sql_executor.cc.
bool slave::QueueConsumer::executeSQLWithCommitId | ( | std::vector< std::string > & | sql, |
const std::string & | commit_id | ||
) | [private] |
Execute a batch of SQL statements.
sql | Batch of SQL statements to execute. |
commit_id | Commit ID value to store in state table. |
true | Success |
false | Failure |
Definition at line 358 of file queue_consumer.cc.
bool slave::QueueConsumer::init | ( | void | ) | [virtual] |
Do any initialization work.
true | Success |
false | Failure |
Reimplemented from slave::QueueThread.
Definition at line 39 of file queue_consumer.cc.
bool slave::QueueConsumer::isEndStatement | ( | const drizzled::message::Statement & | statement | ) | [private] |
Determine if a Statement message is an end message.
Definition at line 285 of file queue_consumer.cc.
bool slave::QueueConsumer::process | ( | ) | [virtual] |
Method that actually does the work around the queue.
Returning 'false' from this method currently causes the thread to shutdown.
true | Success |
false | Failure |
Implements slave::QueueThread.
Definition at line 52 of file queue_consumer.cc.
void slave::QueueConsumer::setApplierState | ( | const std::string & | err_msg, |
bool | status | ||
) |
Update applier status in state table.
err_msg | Error message string |
status | false = STOPPED, true = RUNNING |
Definition at line 317 of file queue_consumer.cc.
void slave::QueueConsumer::shutdown | ( | void | ) | [virtual] |
Work to do at thread shutdown time.
Reimplemented from slave::QueueThread.
Definition at line 46 of file queue_consumer.cc.
uint32_t slave::QueueConsumer::_check_interval [private] |
Number of seconds to sleep between checking queue for messages
Definition at line 73 of file queue_consumer.h.