]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/HitSet: remove unneeded #include - Formatter 9169/head
authorMichal Jarzabek <stiopa@gmail.com>
Mon, 16 May 2016 20:43:21 +0000 (21:43 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Tue, 17 May 2016 17:01:26 +0000 (18:01 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/osd/HitSet.cc
src/osd/HitSet.h

index 597b1f7d8f560e176837c3a0b141930f5cacc89a..c5f7cd5bf39694956d2aa00a5486cfeac4d0f215 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include "HitSet.h"
+#include "common/Formatter.h"
 
 // -- HitSet --
 
@@ -213,3 +214,39 @@ ostream& operator<<(ostream& out, const HitSet::Params& p) {
   out << "}";
   return out;
 }
+
+
+void ExplicitHashHitSet::dump(Formatter *f) const {
+  f->dump_unsigned("insert_count", count);
+  f->open_array_section("hash_set");
+  for (ceph::unordered_set<uint32_t>::const_iterator p = hits.begin();
+       p != hits.end();
+       ++p)
+    f->dump_unsigned("hash", *p);
+  f->close_section();
+}
+
+void ExplicitObjectHitSet::dump(Formatter *f) const {
+  f->dump_unsigned("insert_count", count);
+  f->open_array_section("set");
+  for (ceph::unordered_set<hobject_t>::const_iterator p = hits.begin();
+       p != hits.end();
+       ++p) {
+    f->open_object_section("object");
+    p->dump(f);
+    f->close_section();
+  }
+  f->close_section();
+}
+
+void BloomHitSet::Params::dump(Formatter *f) const {
+  f->dump_float("false_positive_probability", get_fpp());
+  f->dump_int("target_size", target_size);
+  f->dump_int("seed", seed);
+}
+
+void BloomHitSet::dump(Formatter *f) const {
+  f->open_object_section("bloom_filter");
+  bloom.dump(f);
+  f->close_section();
+}
index 42292970f9730448e0c597f5f48a86de8ffec6d6..ecb613363a729e432111324368c3787398f2dd0c 100644 (file)
@@ -21,7 +21,6 @@
 #include "include/unordered_set.h"
 #include "common/bloom_filter.hpp"
 #include "common/hobject.h"
-#include "common/Formatter.h"
 
 /**
  * generic container for a HitSet
@@ -234,13 +233,7 @@ public:
     ::decode(hits, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const {
-    f->dump_unsigned("insert_count", count);
-    f->open_array_section("hash_set");
-    for (ceph::unordered_set<uint32_t>::const_iterator p = hits.begin(); p != hits.end(); ++p)
-      f->dump_unsigned("hash", *p);
-    f->close_section();
-  }
+  void dump(Formatter *f) const;
   static void generate_test_instances(list<ExplicitHashHitSet*>& o) {
     o.push_back(new ExplicitHashHitSet);
     o.push_back(new ExplicitHashHitSet);
@@ -311,16 +304,7 @@ public:
     ::decode(hits, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const {
-    f->dump_unsigned("insert_count", count);
-    f->open_array_section("set");
-    for (ceph::unordered_set<hobject_t>::const_iterator p = hits.begin(); p != hits.end(); ++p) {
-      f->open_object_section("object");
-      p->dump(f);
-      f->close_section();
-    }
-    f->close_section();
-  }
+  void dump(Formatter *f) const;
   static void generate_test_instances(list<ExplicitObjectHitSet*>& o) {
     o.push_back(new ExplicitObjectHitSet);
     o.push_back(new ExplicitObjectHitSet);
@@ -386,11 +370,7 @@ public:
       ::decode(seed, bl);
       DECODE_FINISH(bl);
     }
-    void dump(Formatter *f) const {
-      f->dump_float("false_positive_probability", get_fpp());
-      f->dump_int("target_size", target_size);
-      f->dump_int("seed", seed);
-    }
+    void dump(Formatter *f) const;
     void dump_stream(ostream& o) const {
       o << "false_positive_probability: "
        << get_fpp() << ", target_size: " << target_size
@@ -459,11 +439,7 @@ public:
     ::decode(bloom, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const {
-    f->open_object_section("bloom_filter");
-    bloom.dump(f);
-    f->close_section();
-  }
+  void dump(Formatter *f) const;
   static void generate_test_instances(list<BloomHitSet*>& o) {
     o.push_back(new BloomHitSet);
     o.push_back(new BloomHitSet(10, .1, 1));