~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/rpl_mi.h

  • Committer: Brian Aker
  • Date: 2008-10-08 02:16:25 UTC
  • Revision ID: brian@tangent.org-20081008021625-3756823nqs1phvsn
More effort around master.info (and relay.info)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "rpl_rli.h"
24
24
#include "rpl_reporting.h"
 
25
#include <drizzled/serialize/serialize.h>
 
26
#include <string>
25
27
 
26
28
 
27
29
/*****************************************************************************
59
61
 
60
62
class Master_info : public Slave_reporting_capability
61
63
{
62
 
 public:
 
64
private:
 
65
  drizzle::MasterList list;
 
66
 
 
67
public:
 
68
 
 
69
  /* the variables below are needed because we can change masters on the fly */
 
70
  string master_log_name;
 
71
  string host;
 
72
  string user;
 
73
  string password;
 
74
  uint16_t port;
 
75
  uint32_t connect_retry;
 
76
  off_t master_log_pos;
 
77
  THD *io_thd;
63
78
  Master_info();
64
79
  ~Master_info();
65
80
 
66
 
  /* the variables below are needed because we can change masters on the fly */
67
 
  char master_log_name[FN_REFLEN];
68
 
  char host[HOSTNAME_LENGTH+1];
69
 
  char user[USERNAME_LENGTH+1];
70
 
  char password[MAX_PASSWORD_LENGTH+1];
71
 
 
72
 
  my_off_t master_log_pos;
73
81
  File fd; // we keep the file open, so we need to remember the file pointer
74
82
  IO_CACHE file;
75
83
 
76
84
  pthread_mutex_t data_lock,run_lock;
77
85
  pthread_cond_t data_cond,start_cond,stop_cond;
78
 
  THD *io_thd;
79
86
  DRIZZLE *drizzle;
80
87
  uint32_t file_id;                             /* for 3.23 load data infile */
81
88
  Relay_log_info rli;
82
 
  uint32_t port;
83
 
  uint32_t connect_retry;
84
89
  float heartbeat_period;         // interface with CHANGE MASTER or master.info
85
90
  uint64_t received_heartbeats;  // counter of received heartbeat events
86
91
  int events_till_disconnect;
98
103
 
99
104
  */
100
105
  long clock_diff_with_master;
 
106
  int flush_master_info(bool flush_relay_log_cache);
 
107
  void end_master_info();
 
108
  void init_master_log_pos();
 
109
 
 
110
  int init_master_info(const char* master_info_fname,
 
111
                       const char* slave_info_fname,
 
112
                       bool abort_if_no_master_info_file,
 
113
                       int thread_mask);
 
114
 
 
115
  bool setUsername(const char *username);
 
116
  const char *getUsername();
 
117
 
 
118
  bool setPassword(const char *pword);
 
119
  const char *getPassword();
 
120
 
 
121
  bool setHost(const char *host, uint16_t new_port);
 
122
  const char *getHostname();
 
123
  uint16_t getPort();
 
124
 
 
125
  off_t getLogPosition();
 
126
  bool setLogPosition(off_t position);
 
127
 
 
128
  const char *getLogName();
 
129
  bool setLogName(const char *name);
 
130
 
 
131
  uint32_t getConnectionRetry();
 
132
  bool setConnectionRetry(uint32_t log_position);
 
133
 
101
134
};
102
135
 
103
 
void init_master_log_pos(Master_info* mi);
104
 
int init_master_info(Master_info* mi, const char* master_info_fname,
105
 
                     const char* slave_info_fname,
106
 
                     bool abort_if_no_master_info_file,
107
 
                     int thread_mask);
108
 
void end_master_info(Master_info* mi);
109
 
int flush_master_info(Master_info* mi, bool flush_relay_log_cache);
110
 
 
111
136
#endif /* DRIZZLED_RPL_MI_H */