~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/transaction_reader.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_READER_H
25
 
#define DRIZZLED_PLUGIN_COMMAND_READER_H
 
24
#ifndef DRIZZLED_PLUGIN_TRANSACTION_READER_H
 
25
#define DRIZZLED_PLUGIN_TRANSACTION_READER_H
26
26
 
27
27
#include <drizzled/replication_services.h> /* For global transaction ID typedef */
28
28
 
29
29
/**
30
 
 * @file Defines the API for a CommandReader
 
30
 * @file Defines the API for a TransactionReader
31
31
 *
32
 
 * A command reader is a class which is able to read Command messages from some source
 
32
 * A command reader is a class which is able to read Transaction messages from some source
33
33
 */
34
34
 
35
35
/* some forward declarations needed */
36
36
namespace drizzled
37
37
{
38
 
  namespace message
39
 
  {
40
 
    class Command;
41
 
  }
42
 
}
43
 
 
44
 
namespace drizzled
45
 
{
 
38
 
 
39
namespace message { class Transaction; }
 
40
 
46
41
namespace plugin
47
42
{
48
43
 
49
44
 
50
45
/**
51
 
 * Class which can read Command messages from some source
 
46
 * Class which can read Transaction messages from some source
52
47
 */
53
 
class CommandReader
 
48
class TransactionReader
54
49
{
55
50
public:
56
 
  CommandReader() {}
57
 
  virtual ~CommandReader() {}
 
51
  TransactionReader() {}
 
52
  virtual ~TransactionReader() {}
58
53
  /**
59
 
   * Read and fill a Command message with the supplied
60
 
   * Command message global transaction ID.
 
54
   * Read and fill a Transaction message with the supplied
 
55
   * Transaction message global transaction ID.
61
56
   *
62
57
   * @param Global transaction ID to find
63
58
   * @param Pointer to a command message to fill
64
59
   *
65
60
   * @retval
66
 
   *  true if Command message was read successfully and the supplied pointer
 
61
   *  true if Transaction message was read successfully and the supplied pointer
67
62
   *  to message was filled
68
63
   * @retval
69
64
   *  false if not found or read successfully
70
65
   */
71
66
  virtual bool read(const ReplicationServices::GlobalTransactionId &to_read, 
72
 
                    message::Command *to_fill)= 0;
 
67
                    message::Transaction *to_fill)= 0;
73
68
};
74
69
 
75
70
} /* end namespace drizzled::plugin */
76
71
} /* end namespace drizzled */
77
72
 
78
 
#endif /* DRIZZLED_PLUGIN_COMMAND_READER_H */
 
73
#endif /* DRIZZLED_PLUGIN_TRANSACTION_READER_H */