28
* Defines the API of a simple reader of Command messages from the
28
* Defines the API of a simple reader of Transaction messages from the
29
* Transaction log file.
33
33
* This class is used by other plugins, for instance
34
* the async_replication module, in order to read the command log and
35
* return Command messages.
34
* the async_replication module, in order to read the transaction log and
35
* return Transaction messages.
38
#ifndef PLUGIN_COMMAND_LOG_COMMAND_LOG_READER_H
39
#define PLUGIN_COMMAND_LOG_COMMAND_LOG_READER_H
41
#include "command_log.h"
43
#include <drizzled/plugin/command_reader.h>
38
#ifndef PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_READER_H
39
#define PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_READER_H
41
#include "transaction_log.h"
43
#include <drizzled/plugin/transaction_reader.h>
46
* A class which reads Command messages from the Command log file
46
* A class which reads Transaction messages from the Transaction log file
48
class CommandLogReader :public drizzled::plugin::CommandReader
48
class TransactionLogReader :public drizzled::plugin::TransactionReader
51
/** The Command log object this reader uses */
52
const CommandLog &log;
51
/** The Transaction log object this reader uses */
52
const TransactionLog &log;
54
CommandLogReader(std::string name_arg, const CommandLog &in_log)
55
: drizzled::plugin::CommandReader(name_arg), log(in_log)
54
TransactionLogReader(std::string name_arg, const TransactionLog &in_log)
55
: drizzled::plugin::TransactionReader(name_arg), log(in_log)
59
~CommandLogReader() {}
59
~TransactionLogReader() {}
61
* Read and fill a Command message with the supplied
62
* Command message global transaction ID.
61
* Read and fill a Transaction message with the supplied
62
* Transaction message global transaction ID.
64
64
* @param[in] Global transaction ID to find
65
* @param[out] Pointer to a command message to fill
65
* @param[out] Pointer to a transaction message to fill
68
* true if Command message was read successfully and the supplied pointer to message was filled
68
* true if Transaction message was read successfully and the supplied pointer to message was filled
70
70
* false if not found or read successfully
72
72
bool read(const drizzled::ReplicationServices::GlobalTransactionId &to_read_trx_id,
73
drizzled::message::Command *to_fill);
73
drizzled::message::Transaction *to_fill);
76
#endif /* PLUGIN_COMMAND_LOG_COMMAND_LOG_READER_H */
76
#endif /* PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_READER_H */