Skip to content

Commit

Permalink
Merge pull request #11060 from stiopaa1/mon_osdmonitor_removeAssign
Browse files Browse the repository at this point in the history
mon/OSDMonitor.cc: remove use of boost assign

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Sep 21, 2016
2 parents abf3b4d + 37ea6af commit 4a8bc83
Showing 1 changed file with 43 additions and 40 deletions.
83 changes: 43 additions & 40 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <algorithm>
#include <sstream>
#include <boost/assign.hpp>

#include "OSDMonitor.h"
#include "Monitor.h"
Expand Down Expand Up @@ -3565,48 +3564,52 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
cmd_getval(g_ceph_context, cmdmap, "var", var);

typedef std::map<std::string, osd_pool_get_choices> choices_map_t;
const choices_map_t ALL_CHOICES = boost::assign::map_list_of
("size", SIZE)
("min_size", MIN_SIZE)
("crash_replay_interval", CRASH_REPLAY_INTERVAL)
("pg_num", PG_NUM)("pgp_num", PGP_NUM)("crush_ruleset", CRUSH_RULESET)
("hashpspool", HASHPSPOOL)("nodelete", NODELETE)
("nopgchange", NOPGCHANGE)("nosizechange", NOSIZECHANGE)
("noscrub", NOSCRUB)("nodeep-scrub", NODEEP_SCRUB)
("write_fadvise_dontneed", WRITE_FADVISE_DONTNEED)
("hit_set_type", HIT_SET_TYPE)("hit_set_period", HIT_SET_PERIOD)
("hit_set_count", HIT_SET_COUNT)("hit_set_fpp", HIT_SET_FPP)
("use_gmt_hitset", USE_GMT_HITSET)
("auid", AUID)("target_max_objects", TARGET_MAX_OBJECTS)
("target_max_bytes", TARGET_MAX_BYTES)
("cache_target_dirty_ratio", CACHE_TARGET_DIRTY_RATIO)
("cache_target_dirty_high_ratio", CACHE_TARGET_DIRTY_HIGH_RATIO)
("cache_target_full_ratio", CACHE_TARGET_FULL_RATIO)
("cache_min_flush_age", CACHE_MIN_FLUSH_AGE)
("cache_min_evict_age", CACHE_MIN_EVICT_AGE)
("erasure_code_profile", ERASURE_CODE_PROFILE)
("min_read_recency_for_promote", MIN_READ_RECENCY_FOR_PROMOTE)
("min_write_recency_for_promote", MIN_WRITE_RECENCY_FOR_PROMOTE)
("fast_read", FAST_READ)
("hit_set_grade_decay_rate", HIT_SET_GRADE_DECAY_RATE)
("hit_set_search_last_n", HIT_SET_SEARCH_LAST_N)
("scrub_min_interval", SCRUB_MIN_INTERVAL)
("scrub_max_interval", SCRUB_MAX_INTERVAL)
("deep_scrub_interval", DEEP_SCRUB_INTERVAL)
("recovery_priority", RECOVERY_PRIORITY)
("recovery_op_priority", RECOVERY_OP_PRIORITY)
("scrub_priority", SCRUB_PRIORITY);
const choices_map_t ALL_CHOICES = {
{"size", SIZE},
{"min_size", MIN_SIZE},
{"crash_replay_interval", CRASH_REPLAY_INTERVAL},
{"pg_num", PG_NUM}, {"pgp_num", PGP_NUM}, {"crush_ruleset", CRUSH_RULESET},
{"hashpspool", HASHPSPOOL}, {"nodelete", NODELETE},
{"nopgchange", NOPGCHANGE}, {"nosizechange", NOSIZECHANGE},
{"noscrub", NOSCRUB}, {"nodeep-scrub", NODEEP_SCRUB},
{"write_fadvise_dontneed", WRITE_FADVISE_DONTNEED},
{"hit_set_type", HIT_SET_TYPE}, {"hit_set_period", HIT_SET_PERIOD},
{"hit_set_count", HIT_SET_COUNT}, {"hit_set_fpp", HIT_SET_FPP},
{"use_gmt_hitset", USE_GMT_HITSET},
{"auid", AUID}, {"target_max_objects", TARGET_MAX_OBJECTS},
{"target_max_bytes", TARGET_MAX_BYTES},
{"cache_target_dirty_ratio", CACHE_TARGET_DIRTY_RATIO},
{"cache_target_dirty_high_ratio", CACHE_TARGET_DIRTY_HIGH_RATIO},
{"cache_target_full_ratio", CACHE_TARGET_FULL_RATIO},
{"cache_min_flush_age", CACHE_MIN_FLUSH_AGE},
{"cache_min_evict_age", CACHE_MIN_EVICT_AGE},
{"erasure_code_profile", ERASURE_CODE_PROFILE},
{"min_read_recency_for_promote", MIN_READ_RECENCY_FOR_PROMOTE},
{"min_write_recency_for_promote", MIN_WRITE_RECENCY_FOR_PROMOTE},
{"fast_read", FAST_READ},
{"hit_set_grade_decay_rate", HIT_SET_GRADE_DECAY_RATE},
{"hit_set_search_last_n", HIT_SET_SEARCH_LAST_N},
{"scrub_min_interval", SCRUB_MIN_INTERVAL},
{"scrub_max_interval", SCRUB_MAX_INTERVAL},
{"deep_scrub_interval", DEEP_SCRUB_INTERVAL},
{"recovery_priority", RECOVERY_PRIORITY},
{"recovery_op_priority", RECOVERY_OP_PRIORITY},
{"scrub_priority", SCRUB_PRIORITY},
};

typedef std::set<osd_pool_get_choices> choices_set_t;

const choices_set_t ONLY_TIER_CHOICES = boost::assign::list_of
(HIT_SET_TYPE)(HIT_SET_PERIOD)(HIT_SET_COUNT)(HIT_SET_FPP)
(TARGET_MAX_OBJECTS)(TARGET_MAX_BYTES)(CACHE_TARGET_FULL_RATIO)
(CACHE_TARGET_DIRTY_RATIO)(CACHE_TARGET_DIRTY_HIGH_RATIO)
(CACHE_MIN_FLUSH_AGE)(CACHE_MIN_EVICT_AGE)(MIN_READ_RECENCY_FOR_PROMOTE)
(HIT_SET_GRADE_DECAY_RATE)(HIT_SET_SEARCH_LAST_N);
const choices_set_t ONLY_ERASURE_CHOICES = boost::assign::list_of
(ERASURE_CODE_PROFILE);
const choices_set_t ONLY_TIER_CHOICES = {
{HIT_SET_TYPE}, {HIT_SET_PERIOD}, {HIT_SET_COUNT}, {HIT_SET_FPP},
{TARGET_MAX_OBJECTS}, {TARGET_MAX_BYTES}, {CACHE_TARGET_FULL_RATIO},
{CACHE_TARGET_DIRTY_RATIO}, {CACHE_TARGET_DIRTY_HIGH_RATIO},
{CACHE_MIN_FLUSH_AGE}, {CACHE_MIN_EVICT_AGE},
{MIN_READ_RECENCY_FOR_PROMOTE},
{HIT_SET_GRADE_DECAY_RATE}, {HIT_SET_SEARCH_LAST_N}
};
const choices_set_t ONLY_ERASURE_CHOICES = {
{ERASURE_CODE_PROFILE}
};

choices_set_t selected_choices;
if (var == "all") {
Expand Down

0 comments on commit 4a8bc83

Please sign in to comment.