~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/transaction_applier.h

  • Committer: Jay Pipes
  • Date: 2009-10-07 23:59:47 UTC
  • mto: (1234.1.1 push) (1237.2.10 push)
  • mto: This revision was merged to the branch mainline in revision 1193.
  • Revision ID: jpipes@serialcoder-20091007235947-18simrecnzwv8t1q
Phase 2 new replication work:

* Removes old replication.proto file, old command_transform library
* Removes use of korr.h macro calls in favor of GPB's CodedOutputStream
  API.
* Updates transaction_log, default_replicator, and filtered_replicator module
  to use new Transaction message.
* Updates ReplicationServices to construct the new Transaction messages and
  associated Statement sub-messages
* Corrects transaction boundaries.  AUTOCOMMIT now works properly, and I have
  added a new test case to verify AUTOCOMMIT variable modification of the way
  in which Transaction messages are bundled up and sent across to replicators.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22
22
 */
23
23
 
24
 
#ifndef DRIZZLED_PLUGIN_COMMAND_APPLIER_H
25
 
#define DRIZZLED_PLUGIN_COMMAND_APPLIER_H
 
24
#ifndef DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H
 
25
#define DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H
26
26
 
27
27
/**
28
 
 * @file Defines the API for a CommandApplier
 
28
 * @file Defines the API for a TransactionApplier
29
29
 *
30
 
 * A CommandApplier applies an event it has received from a CommandReplicator (via 
31
 
 * a replicator's replicate() call, or it has read using a CommandReader's read()
 
30
 * A TransactionApplier applies an event it has received from a TransactionReplicator (via 
 
31
 * a replicator's replicate() call, or it has read using a TransactionReader's read()
32
32
 * call.
33
33
 */
34
34
 
35
35
namespace drizzled
36
36
{
37
37
 
38
 
namespace message { class Command; }
 
38
namespace message { class Transaction; }
39
39
 
40
40
namespace plugin
41
41
{
42
42
 
43
43
/**
44
 
 * Base class for appliers of Command messages
 
44
 * Base class for appliers of Transaction messages
45
45
 */
46
 
class CommandApplier
 
46
class TransactionApplier
47
47
{
48
48
public:
49
 
  CommandApplier() {}
50
 
  virtual ~CommandApplier() {}
 
49
  TransactionApplier() {}
 
50
  virtual ~TransactionApplier() {}
51
51
  /**
52
52
   * Apply something to a target.
53
53
   *
61
61
   * the supplied message to their own controlled memory storage
62
62
   * area.
63
63
   *
64
 
   * @param Command message to be replicated
 
64
   * @param Transaction message to be replicated
65
65
   */
66
 
  virtual void apply(const message::Command &to_apply)= 0;
 
66
  virtual void apply(const message::Transaction &to_apply)= 0;
67
67
  /** 
68
68
   * An applier plugin should override this with its
69
69
   * internal method for determining if it is active or not.
70
70
   */
71
71
  virtual bool isActive() {return false;}
72
72
 
73
 
  static bool addPlugin(CommandApplier *applier);
74
 
  static void removePlugin(CommandApplier *applier);
 
73
  static bool addPlugin(TransactionApplier *applier);
 
74
  static void removePlugin(TransactionApplier *applier);
75
75
};
76
76
 
77
77
} /* namespace plugin */
78
78
} /* namespace drizzled */
79
79
 
80
 
#endif /* DRIZZLED_PLUGIN_APPLIER_H */
 
80
#endif /* DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H */