op_wq.dump(&f);
f.close_section();
f.flush(ss);
+ } else if (command == "dump_blacklist") {
+ list<pair<entity_addr_t,utime_t> > bl;
+ OSDMapRef curmap = service.get_osdmap();
+
+ JSONFormatter f(true);
+ f.open_array_section("blacklist");
+ curmap->get_blacklist(&bl);
+ for (list<pair<entity_addr_t,utime_t> >::iterator it = bl.begin();
+ it != bl.end(); ++it) {
+ f.open_array_section("entry");
+ f.open_object_section("entity_addr_t");
+ it->first.dump(&f);
+ f.close_section(); //entity_addr_t
+ it->second.localtime(f.dump_stream("expire_time"));
+ f.close_section(); //entry
+ }
+ f.close_section(); //blacklist
+ f.flush(ss);
} else {
assert(0 == "broken asok registration");
}
r = admin_socket->register_command("dump_op_pq_state", asok_hook,
"dump op priority queue state");
assert(r == 0);
+ r = admin_socket->register_command("dump_blacklist", asok_hook,
+ "dump_blacklist");
+ assert(r == 0);
+
test_ops_hook = new TestOpsSocketHook(&(this->service), this->store);
r = admin_socket->register_command("setomapval", test_ops_hook,
"setomapval <pool-id> <obj-name> <key> <val>");
cct->get_admin_socket()->unregister_command("dump_ops_in_flight");
cct->get_admin_socket()->unregister_command("dump_historic_ops");
cct->get_admin_socket()->unregister_command("dump_op_pq_state");
+ cct->get_admin_socket()->unregister_command("dump_blacklist");
delete asok_hook;
asok_hook = NULL;
return blacklist.count(b);
}
+void OSDMap::get_blacklist(list<pair<entity_addr_t,utime_t> > *bl) const
+{
+ for (hash_map<entity_addr_t,utime_t>::const_iterator it = blacklist.begin() ;
+ it != blacklist.end(); ++it) {
+ bl->push_back(*it);
+ }
+}
+
void OSDMap::set_max_osd(int m)
{
int o = max_osd;
const utime_t& get_modified() const { return modified; }
bool is_blacklisted(const entity_addr_t& a) const;
+ void get_blacklist(list<pair<entity_addr_t,utime_t > > *bl) const;
string get_cluster_snapshot() const {
if (cluster_snapshot_epoch == epoch)