Signed-off-by: Sage Weil <sage@redhat.com>
// the dimensions (pg_num and size) match up.
void OSDMapMapping::_init_mappings(const OSDMap& osdmap)
{
+ num_pgs = 0;
auto q = pools.begin();
for (auto& p : osdmap.get_pools()) {
+ num_pgs += p.second.get_pg_num();
// drop unneeded pools
while (q != pools.end() && q->first < p.first) {
q = pools.erase(q);
std::vector<std::vector<pg_t>> acting_rmap; // osd -> pg
//unused: std::vector<std::vector<pg_t>> up_rmap; // osd -> pg
epoch_t epoch;
+ uint64_t num_pgs = 0;
void _init_mappings(const OSDMap& osdmap);
void _update_range(
epoch_t get_epoch() const {
return epoch;
}
+
+ uint64_t get_num_pgs() const {
+ return num_pgs;
+ }
};
/// thread pool to calculate mapping on multiple CPUs