X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=store.h;h=a959cce9107f6666a5953e5a3259f69b182d54df;hb=1048a6510710acb5bef352d0acb2dd13ecce0e01;hp=75c2008c51368a794ba6764f3da6dae23a30cfbf;hpb=4c7c830e38130011d1f5cc68934a31619e3b8a85;p=cumulus.git diff --git a/store.h b/store.h index 75c2008..a959cce 100644 --- a/store.h +++ b/store.h @@ -17,6 +17,7 @@ #include #include +#include "localdb.h" #include "sha1.h" #include "ref.h" @@ -95,7 +96,9 @@ private: class TarSegmentStore { public: // New segments will be stored in the given directory. - TarSegmentStore(const std::string &path) { this->path = path; } + TarSegmentStore(const std::string &path, + LocalDb *db = NULL) + { this->path = path; this->db = db; } ~TarSegmentStore() { sync(); } // Writes an object to segment in the store, and returns the name @@ -116,10 +119,13 @@ private: Tarfile *file; std::string name; // UUID int count; // Objects written to this segment + std::string basename; // Name of segment without directory + std::string fullname; // Full path to stored segment }; std::string path; std::map segments; + LocalDb *db; // Ensure that all segments in the given group have been fully written. void close_segment(const std::string &group);