forked from cosmos/iavl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.go
37 lines (33 loc) · 851 Bytes
/
options.go
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
package iavl
// Options define customized pruning/writing strategies for the IAVL tree
type Options struct {
KeepEvery int64
KeepRecent int64
Sync bool
}
// DefaultOptions returns the default options for IAVL
func DefaultOptions() *Options {
return &Options{
KeepEvery: 1,
KeepRecent: 0,
Sync: false,
}
}
// PruningOptions returns Options with a given pruning strategy.
// Sync is set to false
func PruningOptions(keepEvery, keepRecent int64) *Options {
return &Options{
KeepEvery: keepEvery,
KeepRecent: keepRecent,
Sync: false,
}
}
// BenchingOptions returns Options intended for benchmark tests
// with a given pruning strategy. Sync is set to true
func BenchingOptions(keepEvery, keepRecent int64) *Options {
return &Options{
KeepEvery: keepEvery,
KeepRecent: keepRecent,
Sync: true,
}
}