~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/default_replicator/default_replicator.cc

Merge replication-pairs

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
 
void DefaultReplicator::replicate(plugin::TransactionApplier *in_applier, message::Transaction &to_replicate)
 
48
plugin::ReplicationReturnCode
 
49
DefaultReplicator::replicate(plugin::TransactionApplier *in_applier,
 
50
                             Session &in_session,
 
51
                             message::Transaction &to_replicate)
66
52
{
67
53
  /* 
68
54
   * We do absolutely nothing but call the applier's apply() method, passing
69
55
   * along the supplied Transaction.  Yep, told you it was simple...
70
56
   */
71
 
  in_applier->apply(to_replicate);
 
57
  return in_applier->apply(in_session, to_replicate);
72
58
}
73
59
 
74
60
static DefaultReplicator *default_replicator= NULL; /* The singleton replicator */
80
66
  return 0;
81
67
}
82
68
 
83
 
static DRIZZLE_SYSVAR_BOOL(
84
 
  enable,
85
 
  sysvar_default_replicator_enable,
86
 
  PLUGIN_VAR_NOCMDARG,
87
 
  N_("Enable default replicator"),
88
 
  NULL, /* check func */
89
 
  NULL, /* update func */
90
 
  false /* default */);
91
 
 
92
 
static drizzle_sys_var* default_replicator_system_variables[]= {
93
 
  DRIZZLE_SYSVAR(enable),
94
 
  NULL
95
 
};
96
 
 
97
 
DRIZZLE_DECLARE_PLUGIN
98
 
{
99
 
  DRIZZLE_VERSION_ID,
100
 
  "default_replicator",
101
 
  "0.1",
102
 
  "Jay Pipes",
103
 
  N_("Default Replicator"),
104
 
  PLUGIN_LICENSE_GPL,
105
 
  init, /* Plugin Init */
106
 
  default_replicator_system_variables, /* system variables */
107
 
  NULL    /* config options */
108
 
}
109
 
DRIZZLE_DECLARE_PLUGIN_END;
 
69
DRIZZLE_PLUGIN(init,  NULL);