-
Notifications
You must be signed in to change notification settings - Fork 63
/
options_restore.go
32 lines (27 loc) · 898 Bytes
/
options_restore.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
package grocksdb
// #include <stdlib.h>
// #include "rocksdb/c.h"
import "C"
// RestoreOptions captures the options to be used during
// restoration of a backup.
type RestoreOptions struct {
c *C.rocksdb_restore_options_t
}
// NewRestoreOptions creates a RestoreOptions instance.
func NewRestoreOptions() *RestoreOptions {
return &RestoreOptions{
c: C.rocksdb_restore_options_create(),
}
}
// SetKeepLogFiles is used to set or unset the keep_log_files option
// If true, restore won't overwrite the existing log files in wal_dir. It will
// also move all log files from archive directory to wal_dir.
// By default, this is false.
func (ro *RestoreOptions) SetKeepLogFiles(v int) {
C.rocksdb_restore_options_set_keep_log_files(ro.c, C.int(v))
}
// Destroy destroys this RestoreOptions instance.
func (ro *RestoreOptions) Destroy() {
C.rocksdb_restore_options_destroy(ro.c)
ro.c = nil
}