#include <fmt/printf.h>
#include <fmt/ranges.h>
+#include "global/global_context.h"
#include "osd/osd_types_fmt.h"
#include "SnapMapReaderI.h"
*/
+#ifdef WITH_SEASTAR
+int OSDriver::get_keys(
+ const std::set<std::string> &keys,
+ std::map<std::string, ceph::buffer::list> *out)
+{
+ return -ENOENT;
+}
+
+int OSDriver::get_next(
+ const std::string &key,
+ std::pair<std::string, ceph::buffer::list> *next)
+{
+ return -ENOENT;
+}
+
+int OSDriver::get_next_or_current(
+ const std::string &key,
+ std::pair<std::string, ceph::buffer::list> *next_or_current)
+{
+ return -ENOENT;
+}
+#else
int OSDriver::get_keys(
const std::set<std::string> &keys,
std::map<std::string, ceph::buffer::list> *out)
return -ENOENT;
}
}
+#endif // WITH_SEASTAR
string SnapMapper::get_prefix(int64_t pool, snapid_t snap)
{
LEGACY_MAPPING_PREFIX;
}
+#ifndef WITH_SEASTAR
/* Octopus modified the SnapMapper key format from
*
* <LEGACY_MAPPING_PREFIX><snapid>_<shardid>_<hobject_t::to_str()>
+ "_" + object_suffix;
}
-#ifndef WITH_SEASTAR
int SnapMapper::convert_legacy(
CephContext *cct,
ObjectStore *store,
#include "common/hobject.h"
#include "common/map_cacher.hpp"
+#ifdef WITH_SEASTAR
+# include "crimson/os/futurized_store.h"
+# include "crimson/os/futurized_collection.h"
+#endif
#include "include/buffer.h"
#include "include/encoding.h"
#include "include/object.h"
#include "osd/SnapMapReaderI.h"
class OSDriver : public MapCacher::StoreDriver<std::string, ceph::buffer::list> {
- ObjectStore *os;
- ObjectStore::CollectionHandle ch;
+#ifdef WITH_SEASTAR
+ using ObjectStoreT = crimson::os::FuturizedStore;
+ using CollectionHandleT = ObjectStoreT::CollectionRef;
+#else
+ using ObjectStoreT = ObjectStore;
+ using CollectionHandleT = ObjectStoreT::CollectionHandle;
+#endif
+
+ ObjectStoreT *os;
+ CollectionHandleT ch;
ghobject_t hoid;
public:
friend class OSDriver;
coll_t cid;
ghobject_t hoid;
- ObjectStore::Transaction *t;
+ ceph::os::Transaction *t;
OSTransaction(
const coll_t &cid,
const ghobject_t &hoid,
- ObjectStore::Transaction *t)
+ ceph::os::Transaction *t)
: cid(cid), hoid(hoid), t(t) {}
public:
void set_keys(
};
OSTransaction get_transaction(
- ObjectStore::Transaction *t) const {
- return OSTransaction(ch->cid, hoid, t);
+ ceph::os::Transaction *t) const {
+ return OSTransaction(ch->get_cid(), hoid, t);
}
- OSDriver(ObjectStore *os, const coll_t& cid, const ghobject_t &hoid) :
+#ifndef WITH_SEASTAR
+ OSDriver(ObjectStoreT *os, const coll_t& cid, const ghobject_t &hoid) :
OSDriver(os, os->open_collection(cid), hoid) {}
- OSDriver(ObjectStore *os, ObjectStore::CollectionHandle ch, const ghobject_t &hoid) :
+#endif
+ OSDriver(ObjectStoreT *os, CollectionHandleT ch, const ghobject_t &hoid) :
os(os),
ch(ch),
hoid(hoid) {}