Verified Commit 847d1e6c authored by Marc Vef's avatar Marc Vef
Browse files

gkfs::metadentry -> gkfs::metadata. Added code to gkfs::metadata

parent 0179b2a1
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ namespace gkfs {
    namespace func {


        std::shared_ptr<Metadata> metadata(const std::string& path, bool follow_links = false);
    std::shared_ptr<gkfs::metadata::Metadata> metadata(const std::string& path, bool follow_links = false);

        int check_parent_dir(const std::string& path);

+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ namespace util {
            return static_cast<typename std::underlying_type<E>::type>(e);
        }

        int metadata_to_stat(const std::string& path, const Metadata& md, struct stat& attr);
int metadata_to_stat(const std::string& path, const gkfs::metadata::Metadata& md, struct stat& attr);

        std::vector<std::pair<std::string, std::string>> load_hostfile(const std::string& lfpath);

+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@

namespace rdb = rocksdb;

namespace gkfs {
namespace metadata {

class MetadataDB {
private:
    std::unique_ptr<rdb::DB> db;
@@ -53,4 +56,7 @@ public:
    void iterate_all();
};

} // namespace metadata
} // namespace gkfs

#endif //GEKKOFS_METADATA_DB_HPP
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@

namespace rdb = rocksdb;

namespace gkfs {
namespace metadata {

enum class OperandID : char {
    increase_size = 'i',
    decrease_size = 'd',
@@ -102,4 +105,7 @@ public:
    bool AllowSingleOperand() const override;
};

} // namespace metadata
} // namespace gkfs

#endif // DB_MERGE_HPP
+7 −3
Original line number Diff line number Diff line
@@ -18,7 +18,11 @@
#include <daemon/daemon.hpp>

/* Forward declarations */
namespace gkfs {
namespace metadata {
class MetadataDB;
}
}

class ChunkStorage;

@@ -43,7 +47,7 @@ private:
    std::string hosts_file_;

    // Database
    std::shared_ptr<MetadataDB> mdb_;
    std::shared_ptr<gkfs::metadata::MetadataDB> mdb_;
    // Storage backend
    std::shared_ptr<ChunkStorage> storage_;

@@ -82,9 +86,9 @@ public:

    void metadir(const std::string& metadir_);

    const std::shared_ptr<MetadataDB>& mdb() const;
    const std::shared_ptr<gkfs::metadata::MetadataDB>& mdb() const;

    void mdb(const std::shared_ptr<MetadataDB>& mdb);
    void mdb(const std::shared_ptr<gkfs::metadata::MetadataDB>& mdb);

    void close_mdb();

Loading