]>
Commit | Line | Data |
---|---|---|
20effc67 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
9f95a23c TL |
4 | #include "futurized_store.h" |
5 | #include "cyanstore/cyan_store.h" | |
20effc67 | 6 | #ifdef WITH_BLUESTORE |
9f95a23c | 7 | #include "alienstore/alien_store.h" |
20effc67 TL |
8 | #endif |
9 | #include "seastore/seastore.h" | |
9f95a23c TL |
10 | |
11 | namespace crimson::os { | |
12 | ||
20effc67 | 13 | seastar::future<std::unique_ptr<FuturizedStore>> |
9f95a23c TL |
14 | FuturizedStore::create(const std::string& type, |
15 | const std::string& data, | |
16 | const ConfigValues& values) | |
17 | { | |
20effc67 TL |
18 | if (type == "cyanstore") { |
19 | return seastar::make_ready_future<std::unique_ptr<FuturizedStore>>( | |
20 | std::make_unique<crimson::os::CyanStore>(data)); | |
21 | } else if (type == "seastore") { | |
22 | return crimson::os::seastore::make_seastore( | |
23 | data, values | |
24 | ).then([] (auto seastore) { | |
25 | return seastar::make_ready_future<std::unique_ptr<FuturizedStore>>( | |
26 | seastore.release()); | |
27 | }); | |
9f95a23c | 28 | } else { |
20effc67 TL |
29 | #ifdef WITH_BLUESTORE |
30 | // use AlienStore as a fallback. It adapts e.g. BlueStore. | |
31 | return seastar::make_ready_future<std::unique_ptr<FuturizedStore>>( | |
32 | std::make_unique<crimson::os::AlienStore>(type, data, values)); | |
33 | #else | |
9f95a23c TL |
34 | ceph_abort_msgf("unsupported objectstore type: %s", type.c_str()); |
35 | return {}; | |
20effc67 | 36 | #endif |
9f95a23c TL |
37 | } |
38 | } | |
39 | ||
40 | } |