mirror of
https://github.com/ceph/ceph
synced 2025-01-02 00:52:22 +00:00
mon/OSDMonitor: Add key/value arguments for pool tagging
Enable the OSDMon to add keys and values to pool tags by application. Signed-off-by: Douglas Fuller <dfuller@redhat.com>
This commit is contained in:
parent
e31075fd1d
commit
d812569dbd
@ -3130,7 +3130,9 @@ void OSDMonitor::check_pg_creates_sub(Subscription *sub)
|
||||
}
|
||||
|
||||
void OSDMonitor::do_application_enable(int64_t pool_id,
|
||||
const std::string &app_name)
|
||||
const std::string &app_name,
|
||||
const std::string &app_key,
|
||||
const std::string &app_value)
|
||||
{
|
||||
assert(paxos->is_plugged() && is_writeable());
|
||||
|
||||
@ -3147,7 +3149,11 @@ void OSDMonitor::do_application_enable(int64_t pool_id,
|
||||
p = pending_inc.new_pools[pool_id];
|
||||
}
|
||||
|
||||
p.application_metadata.insert({app_name, {}});
|
||||
if (app_key.empty()) {
|
||||
p.application_metadata.insert({app_name, {}});
|
||||
} else {
|
||||
p.application_metadata.insert({app_name, {{app_key, app_value}}});
|
||||
}
|
||||
p.last_change = pending_inc.epoch;
|
||||
pending_inc.new_pools[pool_id] = p;
|
||||
}
|
||||
|
@ -539,7 +539,9 @@ public:
|
||||
void check_osdmap_sub(Subscription *sub);
|
||||
void check_pg_creates_sub(Subscription *sub);
|
||||
|
||||
void do_application_enable(int64_t pool_id, const std::string &app_name);
|
||||
void do_application_enable(int64_t pool_id, const std::string &app_name,
|
||||
const std::string &app_key="",
|
||||
const std::string &app_value="");
|
||||
|
||||
void add_flag(int flag) {
|
||||
if (!(osdmap.flags & flag)) {
|
||||
|
Loading…
Reference in New Issue
Block a user