~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/default_replicator/default_replicator.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:
45
45
using namespace std;
46
46
using namespace drizzled;
47
47
 
48
 
static bool sysvar_default_replicator_enable= false;
49
 
 
50
 
bool DefaultReplicator::isEnabled() const
51
 
{
52
 
  return sysvar_default_replicator_enable;
53
 
}
54
 
 
55
 
void DefaultReplicator::enable()
56
 
{
57
 
  sysvar_default_replicator_enable= true;
58
 
}
59
 
 
60
 
void DefaultReplicator::disable()
61
 
{
62
 
  sysvar_default_replicator_enable= false;
63
 
}
64
 
 
65
48
plugin::ReplicationReturnCode
66
49
DefaultReplicator::replicate(plugin::TransactionApplier *in_applier,
67
50
                             Session &in_session,
83
66
  return 0;
84
67
}
85
68
 
86
 
static DRIZZLE_SYSVAR_BOOL(
87
 
  enable,
88
 
  sysvar_default_replicator_enable,
89
 
  PLUGIN_VAR_NOCMDARG,
90
 
  N_("Enable default replicator"),
91
 
  NULL, /* check func */
92
 
  NULL, /* update func */
93
 
  false /* default */);
94
 
 
95
 
static drizzle_sys_var* default_replicator_system_variables[]= {
96
 
  DRIZZLE_SYSVAR(enable),
97
 
  NULL
98
 
};
99
 
 
100
 
DRIZZLE_DECLARE_PLUGIN
101
 
{
102
 
  DRIZZLE_VERSION_ID,
103
 
  "default_replicator",
104
 
  "0.1",
105
 
  "Jay Pipes",
106
 
  N_("Default Replicator"),
107
 
  PLUGIN_LICENSE_GPL,
108
 
  init, /* Plugin Init */
109
 
  default_replicator_system_variables, /* system variables */
110
 
  NULL    /* config options */
111
 
}
112
 
DRIZZLE_DECLARE_PLUGIN_END;
 
69
DRIZZLE_PLUGIN(init,  NULL);