summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-19 08:48:07 -0700
committerSage Weil <sage@inktank.com>2013-09-19 18:27:07 -0700
commitb4e14524072e3a3f1ca831b479017f5e68366168 (patch)
tree3c163014012c90eaf412183875da161a118e6fc9
parent2e3e255f1e82e3dbb09385d6f316e2a288be67d2 (diff)
downloadceph-b4e14524072e3a3f1ca831b479017f5e68366168.tar.gz
osd: add bloom_[fpp,period] to pg_pool_t
Add pool properties to control what type of bloom filter the OSD should track for each PG. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/osd/osd_types.cc15
-rw-r--r--src/osd/osd_types.h8
2 files changed, 19 insertions, 4 deletions
diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc
index aa20dc592fa..589dcaed67f 100644
--- a/src/osd/osd_types.cc
+++ b/src/osd/osd_types.cc
@@ -694,6 +694,8 @@ void pg_pool_t::dump(Formatter *f) const
f->dump_string(name.c_str(), i->second);
}
f->close_section();
+ f->dump_unsigned("bloom_false_positive_probability", bloom_fpp);
+ f->dump_unsigned("bloom_period", bloom_period);
}
@@ -898,7 +900,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
return;
}
- ENCODE_START(10, 5, bl);
+ ENCODE_START(11, 5, bl);
::encode(type, bl);
::encode(size, bl);
::encode(crush_ruleset, bl);
@@ -926,12 +928,14 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
::encode(read_tier, bl);
::encode(write_tier, bl);
::encode(properties, bl);
+ ::encode(bloom_fpp, bl);
+ ::encode(bloom_period, bl);
ENCODE_FINISH(bl);
}
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);
@@ -996,6 +1000,13 @@ void pg_pool_t::decode(bufferlist::iterator& bl)
if (struct_v >= 10) {
::decode(properties, bl);
}
+ if (struct_v >= 11) {
+ ::decode(bloom_fpp, bl);
+ ::decode(bloom_period, bl);
+ } else {
+ bloom_fpp = 0;
+ bloom_period = 0;
+ }
DECODE_FINISH(bl);
calc_pg_masks();
}
diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h
index 091b2b95e8f..e5631b2c67e 100644
--- a/src/osd/osd_types.h
+++ b/src/osd/osd_types.h
@@ -856,7 +856,6 @@ public:
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; }
@@ -864,6 +863,9 @@ public:
bool has_write_tier() const { return write_tier >= 0; }
void clear_write_tier() { write_tier = -1; }
+ uint8_t bloom_fpp; ///< if non-zero, the target false positive probability for bloom filters
+ uint32_t bloom_period; ///< periodicity of bloom filter segments (seconds)
+
pg_pool_t()
: flags(0), type(0), size(0), min_size(0),
crush_ruleset(0), object_hash(0),
@@ -875,7 +877,9 @@ public:
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),
+ bloom_fpp(0),
+ bloom_period(0)
{ }
void dump(Formatter *f) const;