~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/mon/MonClient.h

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum, Clint Byrum, Micah Gersten
  • Date: 2011-02-12 22:50:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110212225026-yyyw4tk0msgql3ul
Tags: 0.24.2-0ubuntu1
[ Clint Byrum <clint@ubuntu.com> ]
* New upstream release. (LP: #658670, LP: #684011)
* debian/patches/fix-mkcephfs.patch: dropped (applied upstream)
* Removed .la files from libceph1-dev, libcrush1-dev and 
  librados1-dev (per Debian policy v3.9.1 10.2).
* debian/control: adding pkg-config as a build dependency
* debian/control: depend on libcrypto++-dev instead of libssl-dev
* debian/watch: added watch file

[ Micah Gersten <micahg@ubuntu.com> ]
* debian/control: add Homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include "messages/MMonSubscribe.h"
29
29
 
 
30
#include <memory>
 
31
 
30
32
class MonMap;
31
33
class MMonMap;
32
34
class MMonSubscribeAck;
49
51
 
50
52
  Messenger *messenger;
51
53
 
52
 
  int cur_mon;
 
54
  string cur_mon;
53
55
 
54
56
  EntityName entity_name;
55
57
 
161
163
 public:
162
164
  MonClient(RotatingKeyRing *rkeys=0) :
163
165
    state(MC_STATE_NONE),
164
 
    messenger(NULL), cur_mon(-1),
 
166
    messenger(NULL),
165
167
    monc_lock("MonClient::monc_lock"),
166
168
    timer(monc_lock),
167
169
    hunting(true),
170
172
    authenticate_err(0),
171
173
    auth(NULL),
172
174
    rotating_secrets(rkeys) { }
 
175
 
173
176
  ~MonClient() {
174
 
    timer.cancel_all_events();
175
177
  }
176
178
 
177
179
  void init();
190
192
    _reopen_session();
191
193
  }
192
194
 
193
 
  entity_addr_t get_my_addr() { return my_addr; }
 
195
  entity_addr_t get_my_addr() const {
 
196
    return my_addr;
 
197
  }
194
198
 
195
199
  const ceph_fsid_t& get_fsid() {
196
200
    return monmap.fsid;
199
203
  entity_addr_t get_mon_addr(unsigned i) {
200
204
    Mutex::Locker l(monc_lock);
201
205
    if (i < monmap.size())
202
 
      return monmap.mon_inst[i].addr;
 
206
      return monmap.get_addr(i);
203
207
    return entity_addr_t();
204
208
  }
205
209
  entity_inst_t get_mon_inst(unsigned i) {
206
210
    Mutex::Locker l(monc_lock);
207
211
    if (i < monmap.size())
208
 
      return monmap.mon_inst[i];
 
212
      return monmap.get_inst(i);
209
213
    return entity_inst_t();
210
214
  }
211
215
  int get_num_mon() {
213
217
    return monmap.size();
214
218
  }
215
219
 
216
 
  uint64_t get_global_id() { return global_id; }
 
220
  uint64_t get_global_id() const {
 
221
    return global_id;
 
222
  }
217
223
 
218
224
  void set_messenger(Messenger *m) { messenger = m; }
219
225