~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/transaction_log/transaction_log_applier.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include <vector>
44
44
#include <string>
45
45
 
 
46
namespace drizzled
 
47
{
 
48
  class Session;
 
49
}
 
50
 
46
51
class TransactionLog;
 
52
class TransactionLogIndex;
 
53
class WriteBuffer;
47
54
 
48
55
class TransactionLogApplier: public drizzled::plugin::TransactionApplier 
49
56
{
50
57
public:
51
58
  TransactionLogApplier(const std::string name_arg,
52
 
                        TransactionLog &in_transaction_log,
53
 
                        bool in_do_checksum);
 
59
                        TransactionLog *in_transaction_log,
 
60
                        TransactionLogIndex *in_transaction_log_index,
 
61
                        uint32_t in_num_write_buffers);
54
62
 
55
63
  /** Destructor */
56
64
  ~TransactionLogApplier();
68
76
   * the supplied message to their own controlled memory storage
69
77
   * area.
70
78
   *
 
79
   * @param Session descriptor
71
80
   * @param Transaction message to be replicated
72
81
   */
73
 
  void apply(const drizzled::message::Transaction &to_apply);
 
82
  drizzled::plugin::ReplicationReturnCode
 
83
  apply(drizzled::Session &in_session,
 
84
        const drizzled::message::Transaction &to_apply);
74
85
private:
75
86
  /* Don't allows these */
76
87
  TransactionLogApplier();
77
88
  TransactionLogApplier(const TransactionLogApplier &other);
78
89
  TransactionLogApplier &operator=(const TransactionLogApplier &other);
79
 
  TransactionLog &transaction_log;
80
 
  bool do_checksum; ///< Do a CRC32 checksum when writing Transaction message to log?
 
90
  /** 
 
91
   * This Applier owns the memory of the associated TransactionLog 
 
92
   * and its index - so we have to track it. 
 
93
   */
 
94
  TransactionLog *transaction_log;
 
95
  TransactionLogIndex *transaction_log_index;
 
96
  uint32_t num_write_buffers; ///< Number of write buffers used
 
97
  std::vector<WriteBuffer *> write_buffers; ///< array of write buffers
 
98
 
 
99
  /**
 
100
   * Returns the write buffer for the supplied session
 
101
   *
 
102
   * @param Session descriptor
 
103
   */
 
104
  WriteBuffer *getWriteBuffer(const drizzled::Session &session);
81
105
};
82
106
 
83
107
#endif /* PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_APPLIER_H */