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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
use ;
/// The block-based table format every oxen database is written in. Raising it makes new
/// databases unreadable to oxen releases built against an older RocksDB.
pub const TABLE_FORMAT_VERSION: i32 = 6;
/// Memtable size for every oxen database. On Linux a database reserves 1.1x this in disk blocks
/// for its write-ahead log from the moment it opens until it closes, so a registry of warm
/// handles ties up that much per handle whether or not it ever writes.
const WRITE_BUFFER_SIZE: usize = 4 * 1024 * 1024;
/// Disk blocks a database reserves for its MANIFEST while it is open. [`default`] rolls the
/// MANIFEST over at a single byte, so oxen's manifests stay far below this.
const MANIFEST_PREALLOCATION_SIZE: usize = 64 * 1024;
/// Writes tables in [`TABLE_FORMAT_VERSION`] for databases opened with `opts`.