~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/replication/replicator/replicator-queue.h

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
        struct priorityq_item item;
9
9
 
10
10
        char *username;
11
 
        enum replication_priority priority;
 
11
        /* dsync state for incremental syncing */
 
12
        char *state;
12
13
        /* last time this user's state was updated */
13
14
        time_t last_update;
14
 
        /* last_fast_run is always >= last_full_run. */
 
15
        /* last_fast_sync is always >= last_full_sync. */
15
16
        time_t last_fast_sync, last_full_sync;
16
17
 
 
18
        enum replication_priority priority;
17
19
        /* User isn't currently in replication queue */
18
20
        unsigned int popped:1;
19
21
        /* Last replication sync failed */
22
24
 
23
25
typedef void replicator_sync_callback_t(bool success, void *context);
24
26
 
25
 
struct replicator_queue *replicator_queue_init(unsigned int full_sync_interval);
 
27
struct replicator_queue *
 
28
replicator_queue_init(unsigned int full_sync_interval,
 
29
                      unsigned int failure_resync_interval);
26
30
void replicator_queue_deinit(struct replicator_queue **queue);
27
31
 
28
32
/* Call the specified callback when data is added/removed/moved in queue
31
35
                                          void (*callback)(void *context),
32
36
                                          void *context);
33
37
 
 
38
/* Lookup an existing user */
 
39
struct replicator_user *
 
40
replicator_queue_lookup(struct replicator_queue *queue, const char *username);
34
41
/* Add a user to queue and return it. If the user already exists, it's updated
35
42
   only if the new priority is higher. */
36
43
struct replicator_user *
57
64
int replicator_queue_import(struct replicator_queue *queue, const char *path);
58
65
int replicator_queue_export(struct replicator_queue *queue, const char *path);
59
66
 
 
67
/* Returns TRUE if user replication can be started now, FALSE if not. When
 
68
   returning FALSE, next_secs_r is set to user's next replication time. */
 
69
bool replicator_queue_want_sync_now(struct replicator_queue *queue,
 
70
                                    struct replicator_user *user,
 
71
                                    unsigned int *next_secs_r);
 
72
/* Iterate through all users in the queue. */
 
73
struct replicator_queue_iter *
 
74
replicator_queue_iter_init(struct replicator_queue *queue);
 
75
struct replicator_user *
 
76
replicator_queue_iter_next(struct replicator_queue_iter *iter);
 
77
void replicator_queue_iter_deinit(struct replicator_queue_iter **iter);
 
78
 
60
79
#endif