Skip to content

Commit f690097

Browse files
authored
fix: update code comments for WithNumCompactors (#1900)
😁 I think the default value of NumCompactors is `4` in comments for WithNumCompactors, it's not 2. Because the value of NumCompactors is 4 in `DefaultOptions` function. [https://github.com/dgraph-io/badger/blob/main/options.go#L148](https://github.com/dgraph-io/badger/blob/main/options.go#L148) ### DefaultOptions ```go // DefaultOptions sets a list of recommended options for good performance. // Feel free to modify these to suit your needs with the WithX methods. func DefaultOptions(path string) Options { return Options{ // ... NumCompactors: 4, // Run at least 2 compactors. Zero-th compactor prioritizes L0. // ... } ``` ### code comments for WithNumCompactors. ```go // WithNumCompactors sets the number of compaction workers to run concurrently. Setting this to // zero stops compactions, which could eventually cause writes to block forever. // // The default value of NumCompactors is 2. One is dedicated just for L0 and L1. func (opt Options) WithNumCompactors(val int) Options { opt.NumCompactors = val return opt } ```
1 parent 89e30b4 commit f690097

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ func (opt Options) WithValueLogMaxEntries(val uint32) Options {
615615
// WithNumCompactors sets the number of compaction workers to run concurrently. Setting this to
616616
// zero stops compactions, which could eventually cause writes to block forever.
617617
//
618-
// The default value of NumCompactors is 2. One is dedicated just for L0 and L1.
618+
// The default value of NumCompactors is 4. One is dedicated just for L0 and L1.
619619
func (opt Options) WithNumCompactors(val int) Options {
620620
opt.NumCompactors = val
621621
return opt

0 commit comments

Comments
 (0)