]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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;} | |
f64942e4 AA |
18 | int parse(const FSMap &fsmap, std::string const &str, |
19 | bool allow_unqualified_rank=true); | |
7c673cae FG |
20 | MDSRoleSelector() |
21 | : fscid(FS_CLUSTER_ID_NONE) | |
22 | {} | |
23 | fs_cluster_id_t get_ns() const | |
24 | { | |
25 | return fscid; | |
26 | } | |
27 | protected: | |
28 | int parse_rank( | |
29 | const FSMap &fsmap, | |
30 | std::string const &str); | |
31 | std::vector<mds_role_t> roles; | |
32 | fs_cluster_id_t fscid; | |
33 | }; | |
34 | ||
35 | #endif // ROLE_SELECTOR_H_ | |
36 |