summaryrefslogtreecommitdiffstats
path: root/src/mon/MonMap.h
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-05-17 06:09:58 +0200
committerSage Weil <sage@inktank.com>2012-05-19 01:21:38 +0200
commit7e6be86785465aecbbeb155548d3aa07c7271b76 (patch)
treef567c08b1858ff08428cc6e33e3ea68ed96dcd3d /src/mon/MonMap.h
parentmonclient: name resolved mon hosts noname-* too (diff)
downloadceph-7e6be86785465aecbbeb155548d3aa07c7271b76.tar.xz
ceph-7e6be86785465aecbbeb155548d3aa07c7271b76.zip
mon: discover peer names during probe
Fill in noname- entires in initial generate monmap (e.g., from mon_host) with real peer names as we discover them. This will make the upcoming initial quorum config check work by letting us identify peers by name. Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/mon/MonMap.h')
-rw-r--r--src/mon/MonMap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mon/MonMap.h b/src/mon/MonMap.h
index f294b497145..f9706fd665b 100644
--- a/src/mon/MonMap.h
+++ b/src/mon/MonMap.h
@@ -120,6 +120,13 @@ class MonMap {
assert(n < rank_name.size());
return rank_name[n];
}
+ string get_name(entity_addr_t a) const {
+ map<entity_addr_t,string>::const_iterator p = addr_name.find(a);
+ if (p == addr_name.end())
+ return string();
+ else
+ return p->second;
+ }
int get_rank(const string& n) {
for (unsigned i=0; i<rank_name.size(); i++)