~stewart/drizzle/use-catalog-for-path

« back to all changes in this revision

Viewing changes to plugin/slave/queue_consumer.h

  • Committer: Lee Bieber
  • Date: 2011-04-02 03:51:56 UTC
  • mfrom: (2260.1.1 revert_slave)
  • Revision ID: kalebral@gmail.com-20110402035156-lhfvo7o6yqtli0xs
Merge Shrews - Revert the multi-master slave plugin changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
  QueueConsumer() :
42
42
    QueueThread(),
43
43
    SQLExecutor("slave", "replication"),
44
 
    _check_interval(5),
45
 
    _ignore_errors(false)
 
44
    _check_interval(5)
46
45
  { }
47
46
 
48
47
  bool init();
60
59
  }
61
60
  
62
61
  /**
63
 
   * Determines if we should ignore errors from statements pulled from masters.
64
 
   */
65
 
  void setIgnoreErrors(bool value)
66
 
  {
67
 
    _ignore_errors= value;
68
 
  }
69
 
 
70
 
  /**
71
62
   * Update applier status in state table.
72
63
   *
73
64
   * @param err_msg Error message string
75
66
   */
76
67
  void setApplierState(const std::string &err_msg, bool status);
77
68
 
78
 
  void addMasterId(uint32_t id)
79
 
  {
80
 
    _master_ids.push_back(id);
81
 
  }
82
 
 
83
 
  bool processSingleMaster(const std::string &master_id);
84
 
 
85
69
private:
86
70
  typedef std::vector<uint64_t> TrxIdList;
87
71
 
88
72
  /** Number of seconds to sleep between checking queue for messages */
89
73
  uint32_t _check_interval;
90
74
 
91
 
  std::vector<uint32_t> _master_ids;
92
 
 
93
 
  bool _ignore_errors;
94
 
 
95
 
  /**
96
 
   * Get a list of transaction IDs from the queue that are complete.
97
 
   *
98
 
   * A "complete" transaction is one in which we have received the end
99
 
   * segment of the transaction.
100
 
   *
101
 
   * @param[in] master_id Identifier of the master we are interested in.
102
 
   * @param[out] list The list to populate with transaction IDs.
103
 
   *
104
 
   * @retval true Success
105
 
   * @retval false Error
106
 
   */
107
 
  bool getListOfCompletedTransactions(const std::string &master_id,
108
 
                                      TrxIdList &list);
 
75
  bool getListOfCompletedTransactions(TrxIdList &list);
109
76
 
110
77
  bool getMessage(drizzled::message::Transaction &transaction,
111
78
                  std::string &commit_id,
112
 
                  const std::string &master_id,
113
79
                  uint64_t trx_id,
114
80
                  uint32_t segment_id);
115
81
 
132
98
   *
133
99
   * @param sql Batch of SQL statements to execute.
134
100
   * @param commit_id Commit ID value to store in state table.
135
 
   * @param master_id ID of the master this SQL came from.
136
101
   *
137
102
   * @retval true Success
138
103
   * @retval false Failure
139
104
   */
140
105
  bool executeSQLWithCommitId(std::vector<std::string> &sql,
141
 
                              const std::string &commit_id,
142
 
                              const std::string &master_id);
 
106
                              const std::string &commit_id);
143
107
  
144
108
  /**
145
109
   * Remove messages for a given transaction from the queue.
146
110
   *
147
 
   * @param[in] master_id ID of the master this transaction was on.
148
 
   * @param[in] trx_id Transaction ID for the messages to remove.
 
111
   * @param trx_id Transaction ID for the messages to remove.
149
112
   *
150
113
   * @retval true Success
151
114
   * @retval false Failure
152
115
   */
153
 
  bool deleteFromQueue(const std::string &master_id, uint64_t trx_id);
 
116
  bool deleteFromQueue(uint64_t trx_id);
154
117
 
155
118
  /**
156
119
   * Determine if a Statement message is an end message.