monmap: filter_initial_members -> set_initial_members

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-05-21 11:36:43 -07:00
parent 34e8169ed6
commit 7b2614b5cf
8 changed files with 19 additions and 19 deletions

View File

@ -188,10 +188,10 @@ int MonMap::build_from_host_list(std::string hostlist, std::string prefix)
return 0;
}
void MonMap::filter_initial_members(CephContext *cct,
list<std::string>& initial_members,
string my_name, entity_addr_t my_addr,
set<entity_addr_t> *removed)
void MonMap::set_initial_members(CephContext *cct,
list<std::string>& initial_members,
string my_name, entity_addr_t my_addr,
set<entity_addr_t> *removed)
{
// remove non-initial members
unsigned i = 0;

View File

@ -237,10 +237,10 @@ class MonMap {
* @param my_addr my addr
* @param removed optional pointer to set to insert removed mon addrs to
*/
void filter_initial_members(CephContext *cct,
list<std::string>& initial_members,
string my_name, entity_addr_t my_addr,
set<entity_addr_t> *removed);
void set_initial_members(CephContext *cct,
list<std::string>& initial_members,
string my_name, entity_addr_t my_addr,
set<entity_addr_t> *removed);
void print(ostream& out) const;
void print_summary(ostream& out) const;

View File

@ -292,8 +292,8 @@ int Monitor::init()
if (initial_members.size()) {
dout(1) << " initial_members " << initial_members << ", filtering seed monmap" << dendl;
monmap->filter_initial_members(g_ceph_context, initial_members, name, messenger->get_myaddr(),
&extra_probe_peers);
monmap->set_initial_members(g_ceph_context, initial_members, name, messenger->get_myaddr(),
&extra_probe_peers);
// (re)calc my rank, in case it changed
rank = monmap->get_rank(name);

View File

@ -30,7 +30,7 @@ using namespace std;
void usage()
{
cout << " usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--filter-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>" << std::endl;
cout << " usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--set-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>" << std::endl;
exit(1);
}
@ -68,7 +68,7 @@ int main(int argc, const char **argv)
clobber = true;
} else if (ceph_argparse_flag(args, i, "--generate", (char*)NULL)) {
generate = true;
} else if (ceph_argparse_flag(args, i, "--filter-initial-members", (char*)NULL)) {
} else if (ceph_argparse_flag(args, i, "--set-initial-members", (char*)NULL)) {
filter = true;
} else if (ceph_argparse_flag(args, i, "--add", (char*)NULL)) {
string name = *i;
@ -151,9 +151,9 @@ int main(int argc, const char **argv)
if (initial_members.size()) {
cout << "initial_members " << initial_members << ", filtering seed monmap" << std::endl;
set<entity_addr_t> removed;
monmap.filter_initial_members(g_ceph_context, initial_members,
string(), entity_addr_t(),
&removed);
monmap.set_initial_members(g_ceph_context, initial_members,
string(), entity_addr_t(),
&removed);
cout << "removed " << removed << std::endl;
}
modified = true;

View File

@ -11,7 +11,7 @@
$ monmaptool --add foo 3.4.5.6:7890 mymonmap
monmaptool: monmap file mymonmap
monmaptool: map already contains mon.foo
usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--filter-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--set-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
[1]
$ monmaptool --print mymonmap

View File

@ -1,3 +1,3 @@
$ monmaptool --help
usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--filter-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--set-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
[1]

View File

@ -9,7 +9,7 @@
monmaptool: monmap file mymonmap
monmaptool: removing doesnotexist
monmaptool: map does not contain doesnotexist
usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--filter-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--set-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
[1]
$ monmaptool --print mymonmap

View File

@ -1,4 +1,4 @@
$ monmaptool
monmaptool: must specify monmap filename
usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--filter-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
usage: [--print] [--create [--clobber][--fsid uuid]] [--generate] [--set-initial-members] [--add name 1.2.3.4:567] [--rm name] <mapfilename>
[1]