]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: remove old handle_command machinery
authorSage Weil <sage@redhat.com>
Wed, 30 Oct 2019 12:29:05 +0000 (07:29 -0500)
committerSage Weil <sage@redhat.com>
Thu, 12 Dec 2019 19:31:26 +0000 (13:31 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h
src/mds/MDSRank.cc
src/mds/MDSRank.h

index 0dc905408336a11dc6e4c9941ffb85af4b397272..a2b519cdb672ab53f0bd430dc92c3a7f9486266b 100644 (file)
@@ -650,74 +650,6 @@ const std::vector<MDSDaemon::MDSCommand>& MDSDaemon::get_commands()
   return commands;
 };
 
-int MDSDaemon::_handle_command(
-    const cmdmap_t &cmdmap,
-    const cref_t<MCommand> &m,
-    bufferlist *outbl,
-    std::string *outs,
-    Context **run_later,
-    bool *need_reply)
-{
-  ceph_assert(outbl != NULL);
-  ceph_assert(outs != NULL);
-
-  std::stringstream ds;
-  std::stringstream ss;
-  std::string prefix;
-  std::string format;
-  std::unique_ptr<Formatter> f(Formatter::create(format));
-  cmd_getval(cct, cmdmap, "prefix", prefix);
-
-  int r = 0;
-
-  if (prefix == "get_command_descriptions") {
-    int cmdnum = 0;
-    std::unique_ptr<JSONFormatter> f(std::make_unique<JSONFormatter>());
-    f->open_object_section("command_descriptions");
-    for (auto& c : get_commands()) {
-      ostringstream secname;
-      secname << "cmd" << setfill('0') << std::setw(3) << cmdnum;
-      dump_cmddesc_to_json(f.get(), m->get_connection()->get_features(),
-                           secname.str(), c.cmdstring, c.helpstring,
-                          c.module, "*", 0);
-      cmdnum++;
-    }
-    f->close_section();        // command_descriptions
-
-    f->flush(ds);
-    goto out; 
-  }
-
-  cmd_getval(cct, cmdmap, "format", format);
-  if (true) {
-    // Give MDSRank a shot at the command
-    if (!mds_rank) {
-      ss << "MDS not active";
-      r = -EINVAL;
-    }
-    else {
-      bool handled;
-      try {
-        handled = mds_rank->handle_command(cmdmap, m, &r, &ds, &ss,
-                                           run_later, need_reply);
-       if (!handled) {
-         // MDSDaemon doesn't know this command
-         ss << "unrecognized command! " << prefix;
-         r = -EINVAL;
-       }
-      } catch (const bad_cmd_get& e) {
-       ss << e.what();
-       r = -EINVAL;
-      }
-    }
-  }
-
-out:
-  *outs = ss.str();
-  outbl->append(ds);
-  return r;
-}
-
 void MDSDaemon::handle_mds_map(const cref_t<MMDSMap> &m)
 {
   version_t epoch = m->get_epoch();
index a3117679862cfea7978a6400c495ef5792a91adc..b511e9f16984daef2d7264858884cbf9e6022e90 100644 (file)
@@ -122,13 +122,6 @@ class MDSDaemon : public Dispatcher {
   
   static void send_command_reply(const cref_t<MCommand> &m, MDSRank* mds_rank, int r,
                                 bufferlist outbl, std::string_view outs);
-  int _handle_command(
-      const cmdmap_t &cmdmap,
-      const cref_t<MCommand> &m,
-      bufferlist *outbl,
-      std::string *outs,
-      Context **run_later,
-      bool *need_reply);
   void handle_command(const cref_t<MCommand> &m);
   void handle_mds_map(const cref_t<MMDSMap> &m);
 
index 68ba408d0153b68da6b47f700f784ce4a7cf9a84..6a311120db44314306e8bba6d87d2c0cb0282be9 100644 (file)
@@ -3499,27 +3499,6 @@ MDSRankDispatcher::MDSRankDispatcher(
     g_conf().add_observer(this);
 }
 
-bool MDSRankDispatcher::handle_command(
-  const cmdmap_t &cmdmap,
-  const cref_t<MCommand> &m,
-  int *r,
-  std::stringstream *ds,
-  std::stringstream *ss,
-  Context **run_later,
-  bool *need_reply)
-{
-  ceph_assert(r != nullptr);
-  ceph_assert(ds != nullptr);
-  ceph_assert(ss != nullptr);
-
-  *need_reply = true;
-
-  std::string prefix;
-  cmd_getval(g_ceph_context, cmdmap, "prefix", prefix);
-
-  return false;
-}
-
 void MDSRank::command_cache_drop(uint64_t timeout, Formatter *f, Context *on_finish) {
   dout(20) << __func__ << dendl;
 
index 4f5bbc7cca07849154ba44a3c4a164d4191c21bb..ea89c1102cc069a4ffe393b4c8ef56cdb71be8e3 100644 (file)
@@ -643,15 +643,6 @@ public:
   const char** get_tracked_conf_keys() const override final;
   void handle_conf_change(const ConfigProxy& conf, const std::set<std::string>& changed) override;
 
-  bool handle_command(
-    const cmdmap_t &cmdmap,
-    const cref_t<MCommand> &m,
-    int *r,
-    std::stringstream *ds,
-    std::stringstream *ss,
-    Context **run_later,
-    bool *need_reply);
-
   void dump_sessions(const SessionFilter &filter, Formatter *f) const;
   void evict_clients(const SessionFilter &filter,
                     std::function<void(int,const std::string&,bufferlist&)> on_finish);