[#773] writecache: Delete unused dbSize param

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-08-26 16:34:34 +03:00 committed by Alex Vanin
parent 9b32b5523d
commit c54f524df9
7 changed files with 0 additions and 27 deletions

View file

@ -348,7 +348,6 @@ func initShardOptions(c *cfg) {
writecache.WithMaxMemSize(writeCacheCfg.MemSize()),
writecache.WithMaxObjectSize(writeCacheCfg.MaxObjectSize()),
writecache.WithSmallObjectSize(writeCacheCfg.SmallObjectSize()),
writecache.WithMaxDBSize(writeCacheCfg.MaxDBSize()),
writecache.WithFlushWorkersCount(writeCacheCfg.WorkersNumber()),
}
}

View file

@ -41,7 +41,6 @@ func TestEngineSection(t *testing.T) {
require.Equal(t, "tmp/0/cache", wc.Path())
require.EqualValues(t, 2147483648, wc.MemSize())
require.EqualValues(t, 2147483648, wc.MaxDBSize())
require.EqualValues(t, 16384, wc.SmallObjectSize())
require.EqualValues(t, 134217728, wc.MaxObjectSize())
require.EqualValues(t, 30, wc.WorkersNumber())
@ -67,7 +66,6 @@ func TestEngineSection(t *testing.T) {
require.Equal(t, "tmp/1/cache", wc.Path())
require.EqualValues(t, 2147483648, wc.MemSize())
require.EqualValues(t, 2147483648, wc.MaxDBSize())
require.EqualValues(t, 16384, wc.SmallObjectSize())
require.EqualValues(t, 134217728, wc.MaxObjectSize())
require.EqualValues(t, 30, wc.WorkersNumber())

View file

@ -60,14 +60,6 @@ func (x *Config) MemSize() uint64 {
return MemSizeDefault
}
// MaxDBSize returns value of "db_size" config parameter.
func (x *Config) MaxDBSize() uint64 {
return config.UintSafe(
(*config.Config)(x),
"db_size",
)
}
// SmallObjectSize returns value of "small_size" config parameter.
//
// Returns SmallSizeDefault if value is not a positive number.

View file

@ -69,7 +69,6 @@ NEOFS_STORAGE_SHARD_NUM=2
NEOFS_STORAGE_SHARD_0_USE_WRITE_CACHE=false
NEOFS_STORAGE_SHARD_0_WRITECACHE_PATH=tmp/0/cache
NEOFS_STORAGE_SHARD_0_WRITECACHE_MEM_SIZE=2147483648
NEOFS_STORAGE_SHARD_0_WRITECACHE_DB_SIZE=2147483648
NEOFS_STORAGE_SHARD_0_WRITECACHE_SMALL_SIZE=16384
NEOFS_STORAGE_SHARD_0_WRITECACHE_MAX_SIZE=134217728
NEOFS_STORAGE_SHARD_0_WRITECACHE_WORKERS_NUMBER=30
@ -98,7 +97,6 @@ NEOFS_STORAGE_SHARD_0_GC_REMOVER_SLEEP_INTERVAL=2m
NEOFS_STORAGE_SHARD_1_USE_WRITE_CACHE=true
NEOFS_STORAGE_SHARD_1_WRITECACHE_PATH=tmp/1/cache
NEOFS_STORAGE_SHARD_1_WRITECACHE_MEM_SIZE=2147483648
NEOFS_STORAGE_SHARD_1_WRITECACHE_DB_SIZE=2147483648
NEOFS_STORAGE_SHARD_1_WRITECACHE_SMALL_SIZE=16384
NEOFS_STORAGE_SHARD_1_WRITECACHE_MAX_SIZE=134217728
NEOFS_STORAGE_SHARD_1_WRITECACHE_WORKERS_NUMBER=30

View file

@ -100,7 +100,6 @@
"writecache": {
"path": "tmp/0/cache",
"mem_size": 2147483648,
"db_size": 2147483648,
"small_size": 16384,
"max_size": 134217728,
"workers_number": 30
@ -132,7 +131,6 @@
"writecache": {
"path": "tmp/1/cache",
"mem_size": 2147483648,
"db_size": 2147483648,
"small_size": 16384,
"max_size": 134217728,
"workers_number": 30

View file

@ -89,7 +89,6 @@ storage:
writecache:
path: tmp/0/cache
mem_size: 2147483648
db_size: 2147483648
small_size: 16384
max_size: 134217728
workers_number: 30
@ -121,7 +120,6 @@ storage:
writecache:
path: tmp/1/cache
mem_size: 2147483648
db_size: 2147483648
small_size: 16384
max_size: 134217728
workers_number: 30

View file

@ -20,9 +20,6 @@ type options struct {
// maxMemSize is the maximum total size of all objects cached in memory.
// 1 GiB by default.
maxMemSize uint64
// maxDBSize is the maximum size of database in bytes.
// Unrestricted by default.
maxDBSize uint64
// 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.
@ -66,13 +63,6 @@ func WithMaxMemSize(sz uint64) Option {
}
}
// WithMaxDBSize sets maximum size for on-disk DB.
func WithMaxDBSize(sz uint64) Option {
return func(o *options) {
o.maxDBSize = sz
}
}
// WithMaxObjectSize sets maximum object size to be stored in write-cache.
func WithMaxObjectSize(sz uint64) Option {
return func(o *options) {