]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: changes "command" to "admin_command" for admin commands.
authorJesse Williamson <jwilliamson@suse.de>
Wed, 21 Dec 2016 02:13:12 +0000 (18:13 -0800)
committerJesse Williamson <jwilliamson@suse.de>
Fri, 31 Mar 2017 08:33:10 +0000 (01:33 -0700)
Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
src/osd/OSD.cc
src/osd/OSD.h

index 92d4e3a6a3cc2da88412a86aaf86f0cc55290043..851de7899ea75b816c2acf1bd50be7623ce37a05 100644 (file)
@@ -1875,17 +1875,17 @@ public:
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
            bufferlist& out) override {
     stringstream ss;
-    bool r = osd->asok_command(command, cmdmap, format, ss);
+    bool r = osd->asok_command(admin_command, cmdmap, format, ss);
     out.append(ss);
     return r;
   }
 };
 
-bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
+bool OSD::asok_command(string admin_command, cmdmap_t& cmdmap, string format,
                       ostream& ss)
 {
   Formatter *f = Formatter::create(format, "json-pretty", "json-pretty");
-  if (command == "status") {
+  if (admin_command == "status") {
     f->open_object_section("status");
     f->dump_stream("cluster_fsid") << superblock.cluster_fsid;
     f->dump_stream("osd_fsid") << superblock.osd_fsid;
@@ -1898,15 +1898,15 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
       f->dump_unsigned("num_pgs", pg_map.size());
     }
     f->close_section();
-  } else if (command == "flush_journal") {
+  } else if (admin_command == "flush_journal") {
     store->flush_journal();
-  } else if (command == "dump_ops_in_flight" ||
-            command == "ops") {
+  } else if (admin_command == "dump_ops_in_flight" ||
+            admin_command == "ops") {
     if (!op_tracker.dump_ops_in_flight(f)) {
       ss << "op_tracker tracking is not enabled now, so no ops are tracked currently, even those get stuck. \
        Please enable \"osd_enable_op_tracker\", and the tracker will start to track new ops received afterwards.";
     }
-  } else if (command == "dump_blocked_ops") {
+  } else if (admin_command == "dump_blocked_ops") {
     if (!op_tracker.dump_ops_in_flight(f, true)) {
       ss << "op_tracker tracking is not enabled now, so no ops are tracked currently, even those get stuck. \
        Please enable \"osd_enable_op_tracker\", and the tracker will start to track new ops received afterwards.";
@@ -1921,11 +1921,11 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
       ss << "op_tracker tracking is not enabled now, so no ops are tracked currently, even those get stuck. \
        Please enable \"osd_enable_op_tracker\", and the tracker will start to track new ops received afterwards.";
     }
-  } else if (command == "dump_op_pq_state") {
+  } else if (admin_command == "dump_op_pq_state") {
     f->open_object_section("pq");
     op_shardedwq.dump(f);
     f->close_section();
-  } else if (command == "dump_blacklist") {
+  } else if (admin_command == "dump_blacklist") {
     list<pair<entity_addr_t,utime_t> > bl;
     OSDMapRef curmap = service.get_osdmap();
 
@@ -1941,7 +1941,7 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
       f->close_section(); //entry
     }
     f->close_section(); //blacklist
-  } else if (command == "dump_watchers") {
+  } else if (admin_command == "dump_watchers") {
     list<obj_watch_item_t> watchers;
     // scan pg's
     {
@@ -1984,7 +1984,7 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
     }
 
     f->close_section(); //watchers
-  } else if (command == "dump_reservations") {
+  } else if (admin_command == "dump_reservations") {
     f->open_object_section("reservations");
     f->open_object_section("local_reservations");
     service.local_reserver.dump(f);
@@ -1993,9 +1993,9 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
     service.remote_reserver.dump(f);
     f->close_section();
     f->close_section();
-  } else if (command == "get_latest_osdmap") {
+  } else if (admin_command == "get_latest_osdmap") {
     get_latest_osdmap();
-  } else if (command == "heap") {
+  } else if (admin_command == "heap") {
     auto result = ceph::osd_cmds::heap(*cct, cmdmap, *f, ss);
 
     // Note: Failed heap profile commands won't necessarily trigger an error:
@@ -2003,7 +2003,7 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
     f->dump_string("error", cpp_strerror(result));
     f->dump_bool("success", result >= 0);
     f->close_section();
-  } else if (command == "set_heap_property") {
+  } else if (admin_command == "set_heap_property") {
     string property;
     int64_t value = 0;
     string error;
@@ -2027,7 +2027,7 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
     f->dump_string("error", error);
     f->dump_bool("success", success);
     f->close_section();
-  } else if (command == "get_heap_property") {
+  } else if (admin_command == "get_heap_property") {
     string property;
     size_t value = 0;
     string error;
@@ -2050,7 +2050,7 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
     store->get_db_statistics(f);
   } else if (command == "dump_scrubs") {
     service.dumps_scrub(f);
-  } else if (command == "calc_objectstore_db_histogram") {
+  } else if (admin_command == "calc_objectstore_db_histogram") {
     store->generate_db_histogram(f);
   } else if (command == "flush_store_cache") {
     store->flush_cache();
index 7efcd376cb4af6185a0da447f46bffafaa616702..f245236f3ead3a44f83216ef3c93a4de80c84dcb 100644 (file)
@@ -1307,7 +1307,7 @@ protected:
   // asok
   friend class OSDSocketHook;
   class OSDSocketHook *asok_hook;
-  bool asok_command(string command, cmdmap_t& cmdmap, string format, ostream& ss);
+  bool asok_command(string admin_command, cmdmap_t& cmdmap, string format, ostream& ss);
 
 public:
   ClassHandler  *class_handler = nullptr;