this helper is only used by the functions in the .cc file, and it does
not reference BlueRocksEnv member variable or methods. so move it to
an anonymous namespace.
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit
c1c90582dbe9274c5004f65d817cc83ef1b3062d)
#include "kv/RocksDBStore.h"
#include "string.h"
+namespace {
+
rocksdb::Status err_to_status(int r)
{
switch (r) {
}
}
+void split(const std::string &fn, std::string *dir, std::string *file)
+{
+ size_t slash = fn.rfind('/');
+ *file = fn.substr(slash + 1);
+ while (slash && fn[slash-1] == '/')
+ --slash;
+ *dir = fn.substr(0, slash);
+}
+
+}
+
// A file abstraction for reading sequentially through a file
class BlueRocksSequentialFile : public rocksdb::SequentialFile {
BlueFS *fs;
class BlueFS;
class BlueRocksEnv : public rocksdb::EnvWrapper {
- void split(const std::string &fn, std::string *dir, std::string *file) {
- size_t slash = fn.rfind('/');
- *file = fn.substr(slash + 1);
- while (slash && fn[slash-1] == '/')
- --slash;
- *dir = fn.substr(0, slash);
- }
-
public:
// Create a brand new sequentially-readable file with the specified name.
// On success, stores a pointer to the new file in *result and returns OK.