From 63b71f677db7e0f90ce084442ae185ffa2cf63c9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 28 Aug 2017 16:34:30 -0400 Subject: [PATCH] mon: remove PGStatService Signed-off-by: Sage Weil --- src/mon/MgrMonitor.cc | 1 - src/mon/MgrStatMonitor.h | 20 +++++++---------- src/mon/Monitor.h | 1 - src/mon/PGMap.h | 1 - src/mon/PGStatService.h | 47 ---------------------------------------- 5 files changed, 8 insertions(+), 62 deletions(-) delete mode 100644 src/mon/PGStatService.h diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index e5fe9d64bbd85..ae501b3593d9c 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -17,7 +17,6 @@ #include "messages/MMgrMap.h" #include "messages/MMgrDigest.h" -#include "PGStatService.h" #include "include/stringify.h" #include "mgr/MgrContext.h" #include "mgr/mgr_commands.h" diff --git a/src/mon/MgrStatMonitor.h b/src/mon/MgrStatMonitor.h index 8fa68b405a241..4f076105fb0cf 100644 --- a/src/mon/MgrStatMonitor.h +++ b/src/mon/MgrStatMonitor.h @@ -8,11 +8,7 @@ #include "mon/PGMap.h" #include "mgr/ServiceMap.h" -class PGStatService; -class MgrPGStatService; - -class MgrStatMonitor : public PaxosService, - public PGStatService { +class MgrStatMonitor : public PaxosService { // live version version_t version = 0; PGMapDigest digest; @@ -68,8 +64,8 @@ public: return service_map; } - // PGStatService - const pool_stat_t* get_pool_stat(int64_t poolid) const override { + // pg stat access + const pool_stat_t* get_pool_stat(int64_t poolid) const { auto i = digest.pg_pool_sum.find(poolid); if (i != digest.pg_pool_sum.end()) { return &i->second; @@ -78,23 +74,23 @@ public: } ceph_statfs get_statfs(OSDMap& osdmap, - boost::optional data_pool) const override { + boost::optional data_pool) const { return digest.get_statfs(osdmap, data_pool); } - void print_summary(Formatter *f, ostream *out) const override { + void print_summary(Formatter *f, ostream *out) const { digest.print_summary(f, out); } - void dump_info(Formatter *f) const override { + void dump_info(Formatter *f) const { digest.dump(f); } void dump_fs_stats(stringstream *ss, Formatter *f, - bool verbose) const override { + bool verbose) const { digest.dump_fs_stats(ss, f, verbose); } void dump_pool_stats(const OSDMap& osdm, stringstream *ss, Formatter *f, - bool verbose) const override { + bool verbose) const { digest.dump_pool_stats_full(osdm, ss, f, verbose); } diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index c3fe86692a2d3..130cf032f27cb 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -37,7 +37,6 @@ #include "Elector.h" #include "Paxos.h" #include "Session.h" -#include "PGStatService.h" #include "MonCommand.h" #include "common/LogClient.h" diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h index 0e61f02d8bfdf..cfb1d6d6bb25b 100644 --- a/src/mon/PGMap.h +++ b/src/mon/PGMap.h @@ -28,7 +28,6 @@ #include "include/mempool.h" #include "mon/health_check.h" #include -#include "mon/PGStatService.h" // FIXME: don't like including this here to get OSDMap::Incremental, maybe // PGMapUpdater needs its own header. diff --git a/src/mon/PGStatService.h b/src/mon/PGStatService.h deleted file mode 100644 index b87284f1c1bc4..0000000000000 --- a/src/mon/PGStatService.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2017 Greg Farnum/Red Hat - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ - -/** - * This service abstracts out the specific implementation providing information - * needed by parts of the Monitor based around PGStats. This'll make for - * an easier transition from the PGMonitor-based queries where we handle - * PGStats directly, to where we are getting information passed in from - * the Ceph Manager. - * - * This initial implementation cheats by wrapping a PGMap so we don't need - * to reimplement everything in one go. - */ - -#ifndef CEPH_PGSTATSERVICE_H -#define CEPH_PGSTATSERVICE_H - -struct creating_pgs_t; - -class PGStatService { -public: - PGStatService() {} - virtual ~PGStatService() {} - - virtual const pool_stat_t* get_pool_stat(int64_t poolid) const = 0; - virtual ceph_statfs get_statfs(OSDMap &osd_map, - boost::optional data_pool) const = 0; - virtual void print_summary(Formatter *f, ostream *out) const = 0; - virtual void dump_info(Formatter *f) const = 0; - virtual void dump_fs_stats(stringstream *ss, Formatter *f, bool verbose) const = 0; - virtual void dump_pool_stats(const OSDMap& osdm, stringstream *ss, Formatter *f, - bool verbose) const = 0; - -}; - -#endif -- 2.39.5