X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftools%2Fcephfs%2FRoleSelector.h;fp=src%2Fceph%2Fsrc%2Ftools%2Fcephfs%2FRoleSelector.h;h=933c51d0f78fd1dacfbd45ba8e178f7168f16c8b;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/tools/cephfs/RoleSelector.h b/src/ceph/src/tools/cephfs/RoleSelector.h new file mode 100644 index 0000000..933c51d --- /dev/null +++ b/src/ceph/src/tools/cephfs/RoleSelector.h @@ -0,0 +1,35 @@ + +#ifndef ROLE_SELECTOR_H_ +#define ROLE_SELECTOR_H_ + +#include +#include +#include "mds/mdstypes.h" +#include "mds/FSMap.h" + +/** + * When you want to let the user act on a single rank in a namespace, + * or all of them. + */ +class MDSRoleSelector +{ + public: + const std::vector &get_roles() const {return roles;} + int parse(const FSMap &fsmap, std::string const &str); + MDSRoleSelector() + : fscid(FS_CLUSTER_ID_NONE) + {} + fs_cluster_id_t get_ns() const + { + return fscid; + } + protected: + int parse_rank( + const FSMap &fsmap, + std::string const &str); + std::vector roles; + fs_cluster_id_t fscid; +}; + +#endif // ROLE_SELECTOR_H_ +