From 25bfd12cf252dbba81f482fe9abe53959f992b4b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 27 Sep 2017 11:19:30 -0400 Subject: [PATCH] mgr/balancer: remove dead code Signed-off-by: Sage Weil (cherry picked from commit 020be37fd06a75ec86e05af966be318c2199da9f) --- src/pybind/mgr/balancer/module.py | 40 ------------------------------- 1 file changed, 40 deletions(-) diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index a0bc919e1508c..ca362471d134b 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -749,46 +749,6 @@ class Module(MgrModule): self.log.debug('weight_set weights %s' % weight_set) return weight_set - def get_util(self, cost_mode, pools, osds): - if cost_mode == 'pg' or \ - cost_mode == 'pg_bytes' or \ - cost_mode == 'pg_objects': - util_map = {} - for osd in osds: - util_map[osd] = 0 - dump = self.get('pg_dump') - #self.log.info('dump %s' % dump) - self.log.info('osds %s' % osds) - for pg in dump['pg_stats']: - inpool = False - for pool in pools: - if pg['pgid'].startswith(str(pool) + '.'): - inpool = True - break - if not inpool: - self.log.info('skipping %s' % pg['pgid']) - continue - self.log.info('pg %s osds %s' % (pg['pgid'], pg['up'])) - for osd in [int(a) for a in pg['up']]: - if osd in osds: - if cost_mode == 'pg': - util_map[osd] += 1 - elif cost_mode == 'pg_bytes': - util_map[osd] += pg['stat_sum']['num_bytes'] - elif cost_mode == 'pg_objects': - util_map[osd] += pg['stat_sum']['num_objects'] - return util_map - else: - raise RuntimeError('unsupported cost mode %s' % cost_mode) - - def get_target(self, util_map): - total = 0 - count = 0 - for k, v in util_map.iteritems(): - total += v; - count += 1 - return total / count - def do_crush(self): self.log.info('do_crush (not yet implemented)') -- 2.39.5