~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/replication_services.h

  • Committer: Brian Aker
  • Date: 2009-09-21 23:40:18 UTC
  • mfrom: (1039.5.63 replication)
  • Revision ID: brian@gaz-20090921234018-gd9kqdyigwxtik9z
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
{
36
36
  namespace plugin
37
37
  {
38
 
    class Replicator;
39
 
    class Applier;
 
38
    class CommandReplicator;
 
39
    class CommandApplier;
40
40
  }
41
41
  namespace message
42
42
  {
44
44
  }
45
45
}
46
46
 
47
 
void add_replicator(drizzled::plugin::Replicator *replicator);
48
 
void remove_replicator(drizzled::plugin::Replicator *replicator);
 
47
void add_replicator(drizzled::plugin::CommandReplicator *replicator);
 
48
void remove_replicator(drizzled::plugin::CommandReplicator *replicator);
49
49
 
50
 
void add_applier(drizzled::plugin::Applier *applier);
51
 
void remove_applier(drizzled::plugin::Applier *applier);
 
50
void add_applier(drizzled::plugin::CommandApplier *applier);
 
51
void remove_applier(drizzled::plugin::CommandApplier *applier);
52
52
 
53
53
/**
54
54
 * This is a class which manages transforming internal 
61
61
{
62
62
public:
63
63
  static const size_t DEFAULT_RECORD_SIZE= 100;
 
64
  typedef uint64_t GlobalTransactionId;
64
65
private:
65
66
  /** 
66
67
   * Atomic boolean set to true if any *active* replicators
73
74
   */
74
75
  atomic<uint64_t> last_applied_timestamp;
75
76
  /** Our collection of replicator plugins */
76
 
  std::vector<drizzled::plugin::Replicator *> replicators;
 
77
  std::vector<drizzled::plugin::CommandReplicator *> replicators;
77
78
  /** Our collection of applier plugins */
78
 
  std::vector<drizzled::plugin::Applier *> appliers;
 
79
  std::vector<drizzled::plugin::CommandApplier *> appliers;
79
80
  /**
80
81
   * Helper method which is called after any change in the
81
82
   * registered appliers or replicators to evaluate whether
89
90
   * the supplied command based on the supplied Session's
90
91
   * transaction information.
91
92
   */
92
 
  void setCommandTransactionContext(drizzled::message::Command *in_command, Session *in_session) const;
 
93
  void setCommandTransactionContext(drizzled::message::Command &in_command, Session *in_session) const;
93
94
  /**
94
95
   * Helper method which pushes a constructed message out
95
96
   * to the registered replicator and applier plugins.
96
97
   *
97
98
   * @param Message to push out
98
99
   */
99
 
  void push(drizzled::message::Command *to_push);
 
100
  void push(drizzled::message::Command &to_push);
100
101
public:
101
102
  /**
102
103
   * Constructor
114
115
   *
115
116
   * @param Pointer to a replicator to attach/register
116
117
   */
117
 
  void attachReplicator(drizzled::plugin::Replicator *in_replicator);
 
118
  void attachReplicator(drizzled::plugin::CommandReplicator *in_replicator);
118
119
  /**
119
120
   * Detaches/unregisters a replicator with our internal
120
121
   * collection of replicators.
121
122
   *
122
123
   * @param Pointer to the replicator to detach
123
124
   */
124
 
  void detachReplicator(drizzled::plugin::Replicator *in_replicator);
 
125
  void detachReplicator(drizzled::plugin::CommandReplicator *in_replicator);
125
126
  /**
126
127
   * Attaches a applier to our internal collection of
127
128
   * appliers.
128
129
   *
129
130
   * @param Pointer to a applier to attach/register
130
131
   */
131
 
  void attachApplier(drizzled::plugin::Applier *in_applier);
 
132
  void attachApplier(drizzled::plugin::CommandApplier *in_applier);
132
133
  /**
133
134
   * Detaches/unregisters a applier with our internal
134
135
   * collection of appliers.
135
136
   *
136
137
   * @param Pointer to the applier to detach
137
138
   */
138
 
  void detachApplier(drizzled::plugin::Applier *in_applier);
 
139
  void detachApplier(drizzled::plugin::CommandApplier *in_applier);
139
140
  /**
140
141
   * Creates a new StartTransaction GPB message and pushes
141
142
   * it to replicators.