Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / tools / cephfs / RoleSelector.h
1
2 #ifndef ROLE_SELECTOR_H_
3 #define ROLE_SELECTOR_H_
4
5 #include <string>
6 #include <vector>
7 #include "mds/mdstypes.h"
8 #include "mds/FSMap.h"
9
10 /**
11  * When you want to let the user act on a single rank in a namespace,
12  * or all of them.
13  */
14 class MDSRoleSelector
15 {
16   public:
17     const std::vector<mds_role_t> &get_roles() const {return roles;}
18     int parse(const FSMap &fsmap, std::string const &str);
19     MDSRoleSelector()
20       : fscid(FS_CLUSTER_ID_NONE)
21     {}
22     fs_cluster_id_t get_ns() const
23     {
24       return fscid;
25     }
26   protected:
27     int parse_rank(
28         const FSMap &fsmap,
29         std::string const &str);
30     std::vector<mds_role_t> roles;
31     fs_cluster_id_t fscid;
32 };
33
34 #endif // ROLE_SELECTOR_H_
35