Dump statistics of data written at the end of a backup run.
[cumulus.git] / store.h
diff --git a/store.h b/store.h
index 1ef5db4..1fd366b 100644 (file)
--- a/store.h
+++ b/store.h
@@ -49,10 +49,11 @@ public:
     Tarfile(const std::string &path, const std::string &segment);
     ~Tarfile();
 
+    int spawn_filter(int fd_out);
     void write_object(int id, const char *data, size_t len);
 
     // Return an estimate of the size of the file.
-    size_t size_estimate() { return size; }
+    size_t size_estimate();
 
     void internal_write_object(const std::string &path,
                                const char *data, size_t len);
@@ -61,6 +62,10 @@ private:
     size_t size;
     std::string segment_name;
     TAR *t;
+
+    /* Filter support. */
+    int real_fd, filter_fd;
+    pid_t filter_pid;
 };
 
 class TarSegmentStore {
@@ -79,6 +84,9 @@ public:
     // Ensure all segments have been fully written.
     void sync();
 
+    // Dump statistics to stdout about how much data has been written
+    void dump_stats();
+
 private:
     struct segment_info {
         Tarfile *file;
@@ -139,4 +147,11 @@ private:
     ObjectReference ref;
 };
 
+/* Program through which segment data is piped before being written to file. */
+extern const char *filter_program;
+
+/* Extension which should be appended to segments written out (.tar is already
+ * included; this adds to it) */
+extern const char *filter_extension;
+
 #endif // _LBS_STORE_H