X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=metadata.h;fp=metadata.h;h=f86244c251da7a12f25b5aa59dc2c583a6462dc1;hb=6cefd6f6bb0c87697930ec6c378353a289f1c867;hp=7a09c7445b60330e7eb1796e8670b0b5a3cce001;hpb=6e0eba0d28ca8d73f199e7b4240b9da2cc96c741;p=cumulus.git diff --git a/metadata.h b/metadata.h index 7a09c74..f86244c 100644 --- a/metadata.h +++ b/metadata.h @@ -10,6 +10,8 @@ #ifndef _LBS_METADATA_H #define _LBS_METADATA_H +#include +#include #include #include @@ -17,17 +19,33 @@ #include "ref.h" #include "util.h" +/* Metadata for a single inode, ready to be written out. */ +struct MetadataItem { + int offset; + std::string text; +}; + class MetadataWriter { public: - MetadataWriter(TarSegmentStore *store); + MetadataWriter(TarSegmentStore *store, const char *path, + const char *snapshot_name, const char *snapshot_scheme); void add(const std::string& path, dictionary info); ObjectReference close(); private: void metadata_flush(); + // Where are objects eventually written to? TarSegmentStore *store; - std::ostringstream metadata, metadata_root; + + // File descriptors for reading/writing local statcache data + std::string statcache_path, statcache_tmp_path; + FILE *statcache_out; + + // Metadata not yet written out to the segment store + size_t chunk_size; + std::list items; + std::ostringstream metadata_root; }; #endif // _LBS_METADATA_H