47
46
#include <drizzled/gettext.h>
48
47
#include <boost/program_options.hpp>
49
48
#include <drizzled/module/option_map.h>
49
#include <drizzled/plugin/function.h>
51
51
namespace po= boost::program_options;
52
52
using namespace std;
160
160
if (sysvar_transaction_log_enabled)
163
transaction_log= new (nothrow) TransactionLog(sysvar_transaction_log_file,
163
transaction_log= new TransactionLog(sysvar_transaction_log_file,
164
164
static_cast<int>(sysvar_transaction_log_flush_frequency),
165
165
sysvar_transaction_log_checksum_enabled);
183
183
/* Create and initialize the transaction log index */
184
transaction_log_index= new (nothrow) TransactionLogIndex(*transaction_log);
185
if (transaction_log_index == NULL)
187
sql_perror(_("Failed to allocate the TransactionLogIndex instance"), sysvar_transaction_log_file);
184
transaction_log_index= new TransactionLogIndex(*transaction_log);
192
185
/* Check to see if the index was not created properly */
193
186
if (transaction_log_index->hasError())
196
189
transaction_log_index->getErrorMessage().c_str());
201
193
/* Create the applier plugin and register it */
202
transaction_log_applier= new (nothrow) TransactionLogApplier("transaction_log_applier",
194
transaction_log_applier= new TransactionLogApplier("transaction_log_applier",
204
196
transaction_log_index,
205
197
static_cast<uint32_t>(sysvar_transaction_log_num_write_buffers));
206
if (transaction_log_applier == NULL)
208
sql_perror(_("Failed to allocate the TransactionLogApplier instance"), sysvar_transaction_log_file);
211
198
context.add(transaction_log_applier);
212
ReplicationServices &replication_services= ReplicationServices::singleton();
213
replication_services.attachApplier(transaction_log_applier,
214
sysvar_transaction_log_use_replicator);
199
ReplicationServices::attachApplier(transaction_log_applier, sysvar_transaction_log_use_replicator);
216
201
/* Setup DATA_DICTIONARY views */
218
transaction_log_tool= new (nothrow) TransactionLogTool;
203
transaction_log_tool= new TransactionLogTool;
219
204
context.add(transaction_log_tool);
220
transaction_log_entries_tool= new (nothrow) TransactionLogEntriesTool;
205
transaction_log_entries_tool= new TransactionLogEntriesTool;
221
206
context.add(transaction_log_entries_tool);
222
transaction_log_transactions_tool= new (nothrow) TransactionLogTransactionsTool;
207
transaction_log_transactions_tool= new TransactionLogTransactionsTool;
223
208
context.add(transaction_log_transactions_tool);
225
210
/* Setup the module's UDFs */
230
215
hexdump_transaction_message_func_factory=
231
216
new plugin::Create_function<HexdumpTransactionMessageFunction>("hexdump_transaction_message");
232
217
context.add(hexdump_transaction_message_func_factory);
235
* Setup the background worker thread which maintains
236
* summary information about the transaction log.
238
if (initTransactionLogBackgroundWorker())
239
return 1; /* Error message output handled in function above */