2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
4
* Copyright (C) 2008-2009 Sun Microsystems
5
* Copyright (c) 2010 Jay Pipes
9
* Jay Pipes <jaypipes@gmail.com>
8
* Jay Pipes <joinfu@sun.com>
11
10
* This program is free software; you can redistribute it and/or modify
12
11
* it under the terms of the GNU General Public License as published by
22
21
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
#ifndef DRIZZLED_PLUGIN_TRANSACTION_REPLICATOR_H
26
#define DRIZZLED_PLUGIN_TRANSACTION_REPLICATOR_H
28
#include "drizzled/plugin/replication.h"
29
#include "drizzled/plugin/plugin.h"
24
#ifndef DRIZZLED_PLUGIN_REPLICATOR_H
25
#define DRIZZLED_PLUGIN_REPLICATOR_H
32
* @file Defines the API for a TransactionReplicator.
28
* @file Defines the API for a Replicator.
34
30
* All a replicator does is replicate/reproduce
35
* events, optionally transforming them before sending them off to a TransactionApplier.
31
* events, optionally transforming them before sending them off to an applier.
37
33
* An applier is responsible for applying events, not a replicator...
36
/* some forward declarations needed */
53
class TransactionApplier;
56
* Class which replicates Transaction messages
52
* Class which replicates Command messages
58
class TransactionReplicator : public Plugin
60
TransactionReplicator();
61
TransactionReplicator(const TransactionReplicator &);
62
TransactionReplicator& operator=(const TransactionReplicator &);
64
explicit TransactionReplicator(std::string name_arg)
65
: Plugin(name_arg, "TransactionReplicator")
68
virtual ~TransactionReplicator() {}
58
virtual ~Replicator() {}
71
* Replicate a Transaction message to a TransactionApplier.
60
* Replicate a Command message to an Applier.
80
69
* the supplied message to their own controlled memory storage
83
* @param Pointer to the applier of the command message
84
* @param Transaction message to be replicated
86
virtual ReplicationReturnCode replicate(TransactionApplier *in_applier,
88
message::Transaction &to_replicate)= 0;
89
static bool addPlugin(TransactionReplicator *replicator);
90
static void removePlugin(TransactionReplicator *replicator);
72
* @param Command message to be replicated
74
virtual void replicate(Applier *in_applier, drizzled::message::Command *to_replicate)= 0;
76
* A replicator plugin should override this with its
77
* internal method for determining if it is active or not.
79
virtual bool isActive() {return false;}
93
} /* namespace plugin */
94
} /* namespace drizzled */
82
} /* end namespace drizzled::plugin */
83
} /* end namespace drizzled */
96
#endif /* DRIZZLED_PLUGIN_TRANSACTION_REPLICATOR_H */
85
#endif /* DRIZZLED_PLUGIN_REPLICATOR_H */