Skip to content

Commit

Permalink
add SetWALRecoveryMode
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuanjin committed Jun 27, 2019
1 parent 20a9aac commit c0434aa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ const (
FatalInfoLogLevel = InfoLogLevel(4)
)

type WALRecoveryMode int

const (
TolerateCorruptedTailRecords = 0
AbsoluteConsistency = 1
PointInTime = 2
SkipAnyCorruptedRecords = 3
)

// Options represent all of the available options when opening a database with Open.
type Options struct {
c *C.rocksdb_options_t
Expand Down Expand Up @@ -801,6 +810,14 @@ func (opts *Options) SetDisableAutoCompactions(value bool) {
C.rocksdb_options_set_disable_auto_compactions(opts.c, C.int(btoi(value)))
}

// SetWALRecoveryMode sets the recovery mode
//
// Recovery mode to control the consistency while replaying WAL
// Default: PointInTime
func (opts *Options) SetWALRecoveryMode(mode WALRecoveryMode) {
C.rocksdb_options_set_wal_recovery_mode(opts.c, C.int(mode))
}

// SetWALTtlSeconds sets the WAL ttl in seconds.
//
// The following two options affect how archived logs will be deleted.
Expand Down

0 comments on commit c0434aa

Please sign in to comment.