f->dump_string(name.c_str(), i->second);
}
f->close_section();
+ f->open_object_section("hit_set_params");
+ hit_set_params.dump(f);
+ f->close_section(); // hit_set_params
+ f->dump_unsigned("hit_set_period", hit_set_period);
+ f->dump_unsigned("hit_set_count", hit_set_count);
}
return;
}
- ENCODE_START(10, 5, bl);
+ __u8 encode_compat = 5;
+ ENCODE_START(11, encode_compat, bl);
::encode(type, bl);
::encode(size, bl);
::encode(crush_ruleset, bl);
::encode(read_tier, bl);
::encode(write_tier, bl);
::encode(properties, bl);
- ENCODE_FINISH(bl);
+ if (hit_set_params.get_type() != HitSet::TYPE_NONE)
+ encode_compat = MAX(encode_compat, 11); // need to be able to understand all the data!
+ ::encode(hit_set_params, bl);
+ ::encode(hit_set_period, bl);
+ ::encode(hit_set_count, bl);
+ ENCODE_FINISH_NEW_COMPAT(bl, encode_compat);
}
void pg_pool_t::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(7, 5, 5, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(11, 5, 5, bl);
::decode(type, bl);
::decode(size, bl);
::decode(crush_ruleset, bl);
if (struct_v >= 10) {
::decode(properties, bl);
}
+ if (struct_v >= 11) {
+ ::decode(hit_set_params, bl);
+ ::decode(hit_set_period, bl);
+ ::decode(hit_set_count, bl);
+ } else {
+ pg_pool_t def;
+ hit_set_period = def.hit_set_period;
+ hit_set_count = def.hit_set_count;
+ }
DECODE_FINISH(bl);
calc_pg_masks();
}
a.write_tier = 1;
a.properties["p-1"] = "v-1";
a.properties["empty"] = string();
+ a.hit_set_params = HitSet::Params(new BloomHitSet::Params);
+ a.hit_set_period = 3600;
+ a.hit_set_count = 8;
o.push_back(new pg_pool_t(a));
}
out << " write_tier " << p.write_tier;
if (p.cache_mode)
out << " cache_mode " << p.get_cache_mode_name();
+ if (p.hit_set_params.get_type() != HitSet::TYPE_NONE) {
+ out << " hit_set (" << p.hit_set_params
+ << ") " << p.hit_set_period << "s"
+ << " x" << p.hit_set_count;
+ }
return out;
}
#include "common/bloom_filter.hpp"
#include "common/hobject.h"
#include "common/snap_types.h"
+#include "HitSet.h"
#include "Watch.h"
#include "OpRequest.h"
int64_t write_tier; ///< pool/tier for objecter to direct writes to
cache_mode_t cache_mode; ///< cache pool mode
-
bool is_tier() const { return tier_of >= 0; }
void clear_tier() { tier_of = -1; }
bool has_read_tier() const { return read_tier >= 0; }
bool has_write_tier() const { return write_tier >= 0; }
void clear_write_tier() { write_tier = -1; }
+ HitSet::Params hit_set_params; ///< The HitSet params to use on this pool
+ uint32_t hit_set_period; ///< periodicity of HitSet segments (seconds)
+ uint32_t hit_set_count; ///< number of periods to retain
+
pg_pool_t()
: flags(0), type(0), size(0), min_size(0),
crush_ruleset(0), object_hash(0),
quota_max_bytes(0), quota_max_objects(0),
pg_num_mask(0), pgp_num_mask(0),
tier_of(-1), read_tier(-1), write_tier(-1),
- cache_mode(CACHEMODE_NONE)
+ cache_mode(CACHEMODE_NONE),
+ hit_set_params(),
+ hit_set_period(0),
+ hit_set_count(0)
{ }
void dump(Formatter *f) const;