1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use PathBuf;
/// Default maximum backup file size - 500 MiB. Divisible by common file block size of 4096 bytes (4 KiB)
pub const DEFAULT_MAX_BACKUP_SIZE: usize = 500 * 2_usize.pow;
/// Default rolling file count - None (unlimited files)
pub const DEFAULT_BACKUP_FILE_COUNT: = None;
/// A policy that is used to configure the disk backup behavior of a Sift stream. Most users wanting disk
/// backups should opt to use the default policy provided by [DiskBackupPolicy::default], however, they are able
/// to completely configure their own.
/// - `backups_dir` is the directory where the backups will get created. If `backups_dir` is
/// `None`, then the user's [data
/// directory](https://docs.rs/dirs/latest/dirs/fn.data_dir.html) is used. If `backups_dir` is provided but
/// doesn't exist, then there will be an attempt to create that directory.
///
/// - `max_backup_file_size` is the maximum size that an individual backup file is allowed to be, befor the
/// file is rolled if using rolling backups, or a checkpoint forced if the max file count is exceeded.
/// Defaults to 500 MiB
///
/// - `rolling_file_policy` is the rolling backup file policy to use
///
/// - `retain_backups` will retain backup files indefinitely, instead of deleting them once a checkpoint
/// has been cleared or the data has otherwise been confirmed to be ingested in Sift.
///
/// **Important Note**: The `max_backup_file_size` does not represent that actual amount of
/// space on disk which is affected by operating system-level compression and block allocation;
/// instead the byte-length is the actual measure.
/// A policy that is used to configure the rolling file policy of a Sift stream. Most users wanting disk
/// backups should opt to use the default policy provided by [RollingFilePolicy::default], however, they are able
/// to completely configure their own.
/// - `max_file_count` is the maximum number of files allowed to exist for a backup. Once this count is reached
/// a checkpoint is forced, and the files are either cleared or re-ingested. None signifies unlimited files