diff options
author | ale <ale@incal.net> | 2019-09-26 12:10:23 +0100 |
---|---|---|
committer | ale <ale@incal.net> | 2019-09-26 12:10:23 +0100 |
commit | 97221e85d5ab47a1443a7aea0b0461bac5230854 (patch) | |
tree | 7a8fe4093e580f1db64822164fb406b866d2b402 /vendor/github.com/syndtr/goleveldb/leveldb/opt | |
parent | 64eb5fb23f64f209e3d813e017097044a111151f (diff) | |
download | crawl-97221e85d5ab47a1443a7aea0b0461bac5230854.tar.gz crawl-97221e85d5ab47a1443a7aea0b0461bac5230854.zip |
Update vendored dependencies
Diffstat (limited to 'vendor/github.com/syndtr/goleveldb/leveldb/opt')
-rw-r--r-- | vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go b/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go index 528b164..c02c1e9 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go @@ -278,6 +278,14 @@ type Options struct { // The default is false. DisableLargeBatchTransaction bool + // DisableSeeksCompaction allows disabling 'seeks triggered compaction'. + // The purpose of 'seeks triggered compaction' is to optimize database so + // that 'level seeks' can be minimized, however this might generate many + // small compaction which may not preferable. + // + // The default is false. + DisableSeeksCompaction bool + // ErrorIfExist defines whether an error should returned if the DB already // exist. // @@ -309,6 +317,8 @@ type Options struct { // IteratorSamplingRate defines approximate gap (in bytes) between read // sampling of an iterator. The samples will be used to determine when // compaction should be triggered. + // Use negative value to disable iterator sampling. + // The iterator sampling is disabled if DisableSeeksCompaction is true. // // The default is 1MiB. IteratorSamplingRate int @@ -526,6 +536,13 @@ func (o *Options) GetDisableLargeBatchTransaction() bool { return o.DisableLargeBatchTransaction } +func (o *Options) GetDisableSeeksCompaction() bool { + if o == nil { + return false + } + return o.DisableSeeksCompaction +} + func (o *Options) GetErrorIfExist() bool { if o == nil { return false @@ -548,8 +565,10 @@ func (o *Options) GetFilter() filter.Filter { } func (o *Options) GetIteratorSamplingRate() int { - if o == nil || o.IteratorSamplingRate <= 0 { + if o == nil || o.IteratorSamplingRate == 0 { return DefaultIteratorSamplingRate + } else if o.IteratorSamplingRate < 0 { + return 0 } return o.IteratorSamplingRate } |