#define CEPH_MON_ONDISK_MAGIC "ceph mon volume v012"
-extern const string CONFIG_PREFIX;
+extern const std::string CONFIG_PREFIX;
// map of entity_type -> features -> count
struct FeatureMap {
return *this;
}
- void encode(bufferlist& bl) const {
+ void encode(ceph::buffer::list& bl) const {
ENCODE_START(1, 1, bl);
encode(m, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::const_iterator& p) {
+ void decode(ceph::buffer::list::const_iterator& p) {
DECODE_START(1, p);
decode(m, p);
DECODE_FINISH(p);
}
- void dump(Formatter *f) const {
+ void dump(ceph::Formatter *f) const {
for (auto& p : m) {
f->open_array_section(ceph_entity_type_name(p.first));
for (auto& q : p.second) {
bytes_misc(0)
{}
- void dump(Formatter *f) const {
+ void dump(ceph::Formatter *f) const {
ceph_assert(f != NULL);
f->dump_int("bytes_total", bytes_total);
f->dump_int("bytes_sst", bytes_sst);
f->dump_stream("last_updated") << last_update;
}
- void encode(bufferlist &bl) const {
+ void encode(ceph::buffer::list &bl) const {
ENCODE_START(1, 1, bl);
encode(bytes_total, bl);
encode(bytes_sst, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::const_iterator &p) {
+ void decode(ceph::buffer::list::const_iterator &p) {
DECODE_START(1, p);
decode(bytes_total, p);
decode(bytes_sst, p);
DECODE_FINISH(p);
}
- static void generate_test_instances(list<LevelDBStoreStats*>& ls) {
+ static void generate_test_instances(std::list<LevelDBStoreStats*>& ls) {
ls.push_back(new LevelDBStoreStats);
ls.push_back(new LevelDBStoreStats);
ls.back()->bytes_total = 1024*1024;
utime_t last_update;
LevelDBStoreStats store_stats;
- void dump(Formatter *f) const {
+ void dump(ceph::Formatter *f) const {
ceph_assert(f != NULL);
f->dump_int("kb_total", (fs_stats.byte_total/1024));
f->dump_int("kb_used", (fs_stats.byte_used/1024));
f->close_section();
}
- void encode(bufferlist &bl) const {
+ void encode(ceph::buffer::list &bl) const {
ENCODE_START(3, 1, bl);
encode(fs_stats.byte_total, bl);
encode(fs_stats.byte_used, bl);
encode(store_stats, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::const_iterator &p) {
+ void decode(ceph::buffer::list::const_iterator &p) {
DECODE_START(1, p);
// we moved from having fields in kb to fields in byte
if (struct_v > 2) {
WRITE_CLASS_ENCODER(DataStats)
struct ScrubResult {
- map<string,uint32_t> prefix_crc; ///< prefix -> crc
- map<string,uint64_t> prefix_keys; ///< prefix -> key count
+ std::map<std::string,uint32_t> prefix_crc; ///< prefix -> crc
+ std::map<std::string,uint64_t> prefix_keys; ///< prefix -> key count
bool operator!=(const ScrubResult& other) {
return prefix_crc != other.prefix_crc || prefix_keys != other.prefix_keys;
}
- void encode(bufferlist& bl) const {
+ void encode(ceph::buffer::list& bl) const {
ENCODE_START(1, 1, bl);
encode(prefix_crc, bl);
encode(prefix_keys, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::const_iterator& p) {
+ void decode(ceph::buffer::list::const_iterator& p) {
DECODE_START(1, p);
decode(prefix_crc, p);
decode(prefix_keys, p);
DECODE_FINISH(p);
}
- void dump(Formatter *f) const {
+ void dump(ceph::Formatter *f) const {
f->open_object_section("crc");
- for (map<string,uint32_t>::const_iterator p = prefix_crc.begin(); p != prefix_crc.end(); ++p)
+ for (auto p = prefix_crc.begin(); p != prefix_crc.end(); ++p)
f->dump_unsigned(p->first.c_str(), p->second);
f->close_section();
f->open_object_section("keys");
- for (map<string,uint64_t>::const_iterator p = prefix_keys.begin(); p != prefix_keys.end(); ++p)
+ for (auto p = prefix_keys.begin(); p != prefix_keys.end(); ++p)
f->dump_unsigned(p->first.c_str(), p->second);
f->close_section();
}
- static void generate_test_instances(list<ScrubResult*>& ls) {
+ static void generate_test_instances(std::list<ScrubResult*>& ls) {
ls.push_back(new ScrubResult);
ls.push_back(new ScrubResult);
ls.back()->prefix_crc["foo"] = 123;
};
WRITE_CLASS_ENCODER(ScrubResult)
-inline ostream& operator<<(ostream& out, const ScrubResult& r) {
+inline std::ostream& operator<<(std::ostream& out, const ScrubResult& r) {
return out << "ScrubResult(keys " << r.prefix_keys << " crc " << r.prefix_crc << ")";
}
/// for information like os, kernel, hostname, memory info, cpu model.
-typedef map<string, string> Metadata;
+typedef std::map<std::string, std::string> Metadata;
namespace ceph {
namespace features {
features &= ~(f.features);
}
- void print(ostream& out) const {
+ void print(std::ostream& out) const {
out << "[";
print_bit_str(features, out, ceph::features::mon::get_feature_name);
out << "]";
}
- void print_with_value(ostream& out) const {
+ void print_with_value(std::ostream& out) const {
out << "[";
print_bit_str(features, out, ceph::features::mon::get_feature_name, true);
out << "]";
}
- void dump(Formatter *f, const char *sec_name = NULL) const {
+ void dump(ceph::Formatter *f, const char *sec_name = NULL) const {
f->open_array_section((sec_name ? sec_name : "features"));
dump_bit_str(features, f, ceph::features::mon::get_feature_name);
f->close_section();
}
- void dump_with_value(Formatter *f, const char *sec_name = NULL) const {
+ void dump_with_value(ceph::Formatter *f, const char *sec_name = NULL) const {
f->open_array_section((sec_name ? sec_name : "features"));
dump_bit_str(features, f, ceph::features::mon::get_feature_name, true);
f->close_section();
}
- void encode(bufferlist& bl) const {
+ void encode(ceph::buffer::list& bl) const {
ENCODE_START(HEAD_VERSION, COMPAT_VERSION, bl);
encode(features, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::const_iterator& p) {
+ void decode(ceph::buffer::list::const_iterator& p) {
DECODE_START(COMPAT_VERSION, p);
decode(features, p);
DECODE_FINISH(p);
return FEATURE_NONE;
}
-inline ostream& operator<<(ostream& out, const mon_feature_t& f) {
+inline std::ostream& operator<<(std::ostream& out, const mon_feature_t& f) {
out << "mon_feature_t(";
f.print(out);
out << ")";
struct ProgressEvent {
- string message; ///< event description
+ std::string message; ///< event description
float progress; ///< [0..1]
- void encode(bufferlist& bl) const {
+ void encode(ceph::buffer::list& bl) const {
ENCODE_START(1, 1, bl);
encode(message, bl);
encode(progress, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::const_iterator& p) {
+ void decode(ceph::buffer::list::const_iterator& p) {
DECODE_START(1, p);
decode(message, p);
decode(progress, p);
DECODE_FINISH(p);
}
- void dump(Formatter *f) const {
+ void dump(ceph::Formatter *f) const {
f->dump_string("message", message);
f->dump_float("progress", progress);
}