[#1367] writecache: Drop BBolt related config variables
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
e39378b1c3
commit
25d2ae8aaf
12 changed files with 17 additions and 118 deletions
|
@ -1,8 +1,6 @@
|
|||
package writecache
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -20,8 +18,6 @@ type options struct {
|
|||
metabase Metabase
|
||||
// maxObjectSize is the maximum size of the object stored in the write-cache.
|
||||
maxObjectSize uint64
|
||||
// smallObjectSize is the maximum size of the object stored in the database.
|
||||
smallObjectSize uint64
|
||||
// workersCount is the number of workers flushing objects in parallel.
|
||||
workersCount int
|
||||
// maxCacheSize is the maximum total size of all objects saved in cache (DB + FS).
|
||||
|
@ -30,10 +26,6 @@ type options struct {
|
|||
// maxCacheCount is the maximum total count of all object saved in cache.
|
||||
// 0 (no limit) by default.
|
||||
maxCacheCount uint64
|
||||
// maxBatchSize is the maximum batch size for the small object database.
|
||||
maxBatchSize int
|
||||
// maxBatchDelay is the maximum batch wait time for the small object database.
|
||||
maxBatchDelay time.Duration
|
||||
// noSync is true iff FSTree allows unsynchronized writes.
|
||||
noSync bool
|
||||
// reportError is the function called when encountering disk errors in background workers.
|
||||
|
@ -42,8 +34,6 @@ type options struct {
|
|||
metrics Metrics
|
||||
// disableBackgroundFlush is for testing purposes only.
|
||||
disableBackgroundFlush bool
|
||||
// pageSize is bbolt's page size config value
|
||||
pageSize int
|
||||
// flushSizeLimit is total size of flushing objects.
|
||||
flushSizeLimit uint64
|
||||
}
|
||||
|
@ -85,15 +75,6 @@ func WithMaxObjectSize(sz uint64) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithSmallObjectSize sets maximum object size to be stored in write-cache.
|
||||
func WithSmallObjectSize(sz uint64) Option {
|
||||
return func(o *options) {
|
||||
if sz > 0 {
|
||||
o.smallObjectSize = sz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func WithFlushWorkersCount(c int) Option {
|
||||
return func(o *options) {
|
||||
if c > 0 {
|
||||
|
@ -116,24 +97,6 @@ func WithMaxCacheCount(v uint64) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithMaxBatchSize sets max batch size for the small object database.
|
||||
func WithMaxBatchSize(sz int) Option {
|
||||
return func(o *options) {
|
||||
if sz > 0 {
|
||||
o.maxBatchSize = sz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithMaxBatchDelay sets max batch delay for the small object database.
|
||||
func WithMaxBatchDelay(d time.Duration) Option {
|
||||
return func(o *options) {
|
||||
if d > 0 {
|
||||
o.maxBatchDelay = d
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithNoSync sets an option to allow returning to caller on PUT before write is persisted.
|
||||
// Note, that we use this flag for FSTree only and DO NOT use it for a bolt DB because
|
||||
// we cannot yet properly handle the corrupted database during the startup. This SHOULD NOT
|
||||
|
@ -165,13 +128,6 @@ func WithDisableBackgroundFlush() Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithPageSize sets bbolt's page size.
|
||||
func WithPageSize(s int) Option {
|
||||
return func(o *options) {
|
||||
o.pageSize = s
|
||||
}
|
||||
}
|
||||
|
||||
// WithFlushSizeLimit sets flush size limit.
|
||||
func WithFlushSizeLimit(v uint64) Option {
|
||||
return func(o *options) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue