~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/transaction_replicator.h

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:
25
25
#ifndef DRIZZLED_PLUGIN_TRANSACTION_REPLICATOR_H
26
26
#define DRIZZLED_PLUGIN_TRANSACTION_REPLICATOR_H
27
27
 
28
 
#include "drizzled/atomics.h"
29
28
#include "drizzled/plugin/replication.h"
30
29
#include "drizzled/plugin/plugin.h"
31
30
 
61
60
  TransactionReplicator();
62
61
  TransactionReplicator(const TransactionReplicator &);
63
62
  TransactionReplicator& operator=(const TransactionReplicator &);
64
 
  atomic<bool> is_enabled;
65
63
public:
66
64
  explicit TransactionReplicator(std::string name_arg)
67
65
    : Plugin(name_arg, "TransactionReplicator")
68
66
  {
69
 
    is_enabled= true;
70
67
  }
71
68
  virtual ~TransactionReplicator() {}
72
69
 
91
88
                                          message::Transaction &to_replicate)= 0;
92
89
  static bool addPlugin(TransactionReplicator *replicator);
93
90
  static void removePlugin(TransactionReplicator *replicator);
94
 
 
95
 
  virtual bool isEnabled() const
96
 
  {
97
 
    return is_enabled;
98
 
  }
99
 
 
100
 
  virtual void enable()
101
 
  {
102
 
    is_enabled= true;
103
 
  }
104
 
 
105
 
  virtual void disable()
106
 
  {
107
 
    is_enabled= false;
108
 
  }
109
91
};
110
92
 
111
93
} /* namespace plugin */