~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/module.cc

This patch adds the following functionality:

* Removes the need to manually enable replicators in order
  for an applier to work.
* Removes the enabled/disabled setting of both transaction
  applier plugins and transaction replicator plugins
* Pairs a replicator with an applier into a "ReplicationStream"
  and removes all checks for "enabled" replicators and appliers
* Allows modules that implement a TransactionApplier (such as
  the transaction_log module) to specify which replicator to
  use via a configuration variable.  For instance, the transaction
  log module now has --transaction-log-use-replicator=[default|filtered..]
  instead of the user having to do --default-replicator-enable and such
* Adds a new data dictionary table for REPLICATION_STREAMS, which
  allows querying of activated replication-to-applier streams
  managed by drizzled::ReplicationServices

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 * for managing write buffers
86
86
 */
87
87
static uint32_t sysvar_transaction_log_num_write_buffers= 8;
 
88
/**
 
89
 * Transaction Log plugin system variable - The name of the replicator plugin
 
90
 * to pair the transaction log's applier with.  Defaults to "default"
 
91
 */
 
92
static char *sysvar_transaction_log_use_replicator= NULL;
 
93
static const char DEFAULT_USE_REPLICATOR[]= "default";
88
94
 
89
95
/** DATA_DICTIONARY views */
90
96
static TransactionLogTool *transaction_log_tool;
138
144
      return 1;
139
145
    }
140
146
    context.add(transaction_log_applier);
 
147
    ReplicationServices &replication_services= ReplicationServices::singleton();
 
148
    string replicator_name(sysvar_transaction_log_use_replicator);
 
149
    replication_services.attachApplier(transaction_log_applier, replicator_name);
141
150
 
142
151
    /* Setup DATA_DICTIONARY views */
143
152
 
230
239
                          NULL, /* update func*/
231
240
                          DEFAULT_LOG_FILE_PATH /* default */);
232
241
 
 
242
static DRIZZLE_SYSVAR_STR(use_replicator,
 
243
                          sysvar_transaction_log_use_replicator,
 
244
                          PLUGIN_VAR_READONLY,
 
245
                          N_("Name of the replicator plugin to use (default='default_replicator')"),
 
246
                          NULL, /* check func */
 
247
                          NULL, /* update func*/
 
248
                          DEFAULT_USE_REPLICATOR /* default */);
 
249
 
233
250
static DRIZZLE_SYSVAR_BOOL(enable_checksum,
234
251
                           sysvar_transaction_log_checksum_enabled,
235
252
                           PLUGIN_VAR_NOCMDARG,
269
286
  DRIZZLE_SYSVAR(enable_checksum),
270
287
  DRIZZLE_SYSVAR(sync_method),
271
288
  DRIZZLE_SYSVAR(num_write_buffers),
 
289
  DRIZZLE_SYSVAR(use_replicator),
272
290
  NULL
273
291
};
274
292