]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/crush/CrushLocation.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / crimson / crush / CrushLocation.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 #pragma once
4
5 #include <iosfwd>
6 #include <map>
7 #include <string>
8 #if FMT_VERSION >= 90000
9 #include <fmt/ostream.h>
10 #endif
11
12 #include <seastar/core/seastar.hh>
13
14 namespace crimson::crush {
15
16 class CrushLocation {
17 public:
18 explicit CrushLocation() {
19 }
20
21 seastar::future<> update_from_conf(); ///< refresh from config
22 seastar::future<> init_on_startup();
23 seastar::future<> update_from_hook(); ///< call hook, if present
24
25 std::multimap<std::string, std::string> get_location() const;
26
27 private:
28 void _parse(const std::string& s);
29 std::multimap<std::string, std::string> loc;
30 };
31
32 std::ostream& operator<<(std::ostream& os, const CrushLocation& loc);
33 }
34
35 #if FMT_VERSION >= 90000
36 template <> struct fmt::formatter<crimson::crush::CrushLocation> : fmt::ostream_formatter {};
37 #endif