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 Original line Diff line number Diff line
@@ -39,7 +39,7 @@ namespace gkfs {
    namespace func {
    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);
        int check_parent_dir(const std::string& path);


+1 −1
Original line number Original line Diff line number Diff line
@@ -48,7 +48,7 @@ namespace util {
            return static_cast<typename std::underlying_type<E>::type>(e);
            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);
        std::vector<std::pair<std::string, std::string>> load_hostfile(const std::string& lfpath);


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


namespace rdb = rocksdb;
namespace rdb = rocksdb;


namespace gkfs {
namespace metadata {

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


} // namespace metadata
} // namespace gkfs

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


namespace rdb = rocksdb;
namespace rdb = rocksdb;


namespace gkfs {
namespace metadata {

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


} // namespace metadata
} // namespace gkfs

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


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


class ChunkStorage;
class ChunkStorage;


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


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


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


    void metadir(const std::string& metadir_);
    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();
    void close_mdb();


Loading