summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/lib/src/gf-changelog-helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/changelog/lib/src/gf-changelog-helpers.h')
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-helpers.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog-helpers.h b/xlators/features/changelog/lib/src/gf-changelog-helpers.h
index 2d545da9e82..218896b86e7 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-helpers.h
+++ b/xlators/features/changelog/lib/src/gf-changelog-helpers.h
@@ -24,6 +24,7 @@
#define GF_CHANGELOG_PROCESSED_DIR ".processed"
#define GF_CHANGELOG_PROCESSING_DIR ".processing"
#define GF_CHANGELOG_HISTORY_DIR ".history"
+#define TIMESTAMP_LENGTH 10
#ifndef MAXLINE
#define MAXLINE 4096
@@ -72,8 +73,45 @@ typedef struct gf_changelog {
/* Holds gfc for History API */
struct gf_changelog *hist_gfc;
+
+ /* holds 0 done scanning, 1 keep scanning and -1 error */
+ int hist_done;
} gf_changelog_t;
+typedef struct gf_changelog_history_data {
+ int len;
+
+ int htime_fd;
+
+ /* parallelism count */
+ int n_parallel;
+
+ /* history from, to indexes */
+ unsigned long from;
+ unsigned long to;
+} gf_changelog_history_data_t;
+
+typedef struct gf_changelog_consume_data {
+ /** set of inputs */
+
+ /* fd to read from */
+ int fd;
+
+ /* from @offset */
+ off_t offset;
+
+ xlator_t *this;
+ gf_changelog_t *gfc;
+
+ /** set of outputs */
+
+ /* return value */
+ int retval;
+
+ /* journal processed */
+ char changelog[PATH_MAX];
+} gf_changelog_consume_data_t;
+
int
gf_changelog_notification_init (xlator_t *this, gf_changelog_t *gfc);
@@ -98,4 +136,11 @@ gf_ftruncate (int fd, off_t length);
off_t
gf_lseek (int fd, off_t offset, int whence);
+int
+gf_changelog_consume (xlator_t *this,
+ gf_changelog_t *gfc,
+ char *from_path, gf_boolean_t no_publish);
+int
+gf_changelog_publish (xlator_t *this, gf_changelog_t *gfc, char *from_path);
+
#endif