forked from TrueCloudLab/frostfs-node
[#773] writecache: Delete unused dbSize
param
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
9b32b5523d
commit
c54f524df9
7 changed files with 0 additions and 27 deletions
|
@ -348,7 +348,6 @@ func initShardOptions(c *cfg) {
|
||||||
writecache.WithMaxMemSize(writeCacheCfg.MemSize()),
|
writecache.WithMaxMemSize(writeCacheCfg.MemSize()),
|
||||||
writecache.WithMaxObjectSize(writeCacheCfg.MaxObjectSize()),
|
writecache.WithMaxObjectSize(writeCacheCfg.MaxObjectSize()),
|
||||||
writecache.WithSmallObjectSize(writeCacheCfg.SmallObjectSize()),
|
writecache.WithSmallObjectSize(writeCacheCfg.SmallObjectSize()),
|
||||||
writecache.WithMaxDBSize(writeCacheCfg.MaxDBSize()),
|
|
||||||
writecache.WithFlushWorkersCount(writeCacheCfg.WorkersNumber()),
|
writecache.WithFlushWorkersCount(writeCacheCfg.WorkersNumber()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@ func TestEngineSection(t *testing.T) {
|
||||||
|
|
||||||
require.Equal(t, "tmp/0/cache", wc.Path())
|
require.Equal(t, "tmp/0/cache", wc.Path())
|
||||||
require.EqualValues(t, 2147483648, wc.MemSize())
|
require.EqualValues(t, 2147483648, wc.MemSize())
|
||||||
require.EqualValues(t, 2147483648, wc.MaxDBSize())
|
|
||||||
require.EqualValues(t, 16384, wc.SmallObjectSize())
|
require.EqualValues(t, 16384, wc.SmallObjectSize())
|
||||||
require.EqualValues(t, 134217728, wc.MaxObjectSize())
|
require.EqualValues(t, 134217728, wc.MaxObjectSize())
|
||||||
require.EqualValues(t, 30, wc.WorkersNumber())
|
require.EqualValues(t, 30, wc.WorkersNumber())
|
||||||
|
@ -67,7 +66,6 @@ func TestEngineSection(t *testing.T) {
|
||||||
|
|
||||||
require.Equal(t, "tmp/1/cache", wc.Path())
|
require.Equal(t, "tmp/1/cache", wc.Path())
|
||||||
require.EqualValues(t, 2147483648, wc.MemSize())
|
require.EqualValues(t, 2147483648, wc.MemSize())
|
||||||
require.EqualValues(t, 2147483648, wc.MaxDBSize())
|
|
||||||
require.EqualValues(t, 16384, wc.SmallObjectSize())
|
require.EqualValues(t, 16384, wc.SmallObjectSize())
|
||||||
require.EqualValues(t, 134217728, wc.MaxObjectSize())
|
require.EqualValues(t, 134217728, wc.MaxObjectSize())
|
||||||
require.EqualValues(t, 30, wc.WorkersNumber())
|
require.EqualValues(t, 30, wc.WorkersNumber())
|
||||||
|
|
|
@ -60,14 +60,6 @@ func (x *Config) MemSize() uint64 {
|
||||||
return MemSizeDefault
|
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.
|
// SmallObjectSize returns value of "small_size" config parameter.
|
||||||
//
|
//
|
||||||
// Returns SmallSizeDefault if value is not a positive number.
|
// Returns SmallSizeDefault if value is not a positive number.
|
||||||
|
|
|
@ -69,7 +69,6 @@ NEOFS_STORAGE_SHARD_NUM=2
|
||||||
NEOFS_STORAGE_SHARD_0_USE_WRITE_CACHE=false
|
NEOFS_STORAGE_SHARD_0_USE_WRITE_CACHE=false
|
||||||
NEOFS_STORAGE_SHARD_0_WRITECACHE_PATH=tmp/0/cache
|
NEOFS_STORAGE_SHARD_0_WRITECACHE_PATH=tmp/0/cache
|
||||||
NEOFS_STORAGE_SHARD_0_WRITECACHE_MEM_SIZE=2147483648
|
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_SMALL_SIZE=16384
|
||||||
NEOFS_STORAGE_SHARD_0_WRITECACHE_MAX_SIZE=134217728
|
NEOFS_STORAGE_SHARD_0_WRITECACHE_MAX_SIZE=134217728
|
||||||
NEOFS_STORAGE_SHARD_0_WRITECACHE_WORKERS_NUMBER=30
|
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_USE_WRITE_CACHE=true
|
||||||
NEOFS_STORAGE_SHARD_1_WRITECACHE_PATH=tmp/1/cache
|
NEOFS_STORAGE_SHARD_1_WRITECACHE_PATH=tmp/1/cache
|
||||||
NEOFS_STORAGE_SHARD_1_WRITECACHE_MEM_SIZE=2147483648
|
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_SMALL_SIZE=16384
|
||||||
NEOFS_STORAGE_SHARD_1_WRITECACHE_MAX_SIZE=134217728
|
NEOFS_STORAGE_SHARD_1_WRITECACHE_MAX_SIZE=134217728
|
||||||
NEOFS_STORAGE_SHARD_1_WRITECACHE_WORKERS_NUMBER=30
|
NEOFS_STORAGE_SHARD_1_WRITECACHE_WORKERS_NUMBER=30
|
||||||
|
|
|
@ -100,7 +100,6 @@
|
||||||
"writecache": {
|
"writecache": {
|
||||||
"path": "tmp/0/cache",
|
"path": "tmp/0/cache",
|
||||||
"mem_size": 2147483648,
|
"mem_size": 2147483648,
|
||||||
"db_size": 2147483648,
|
|
||||||
"small_size": 16384,
|
"small_size": 16384,
|
||||||
"max_size": 134217728,
|
"max_size": 134217728,
|
||||||
"workers_number": 30
|
"workers_number": 30
|
||||||
|
@ -132,7 +131,6 @@
|
||||||
"writecache": {
|
"writecache": {
|
||||||
"path": "tmp/1/cache",
|
"path": "tmp/1/cache",
|
||||||
"mem_size": 2147483648,
|
"mem_size": 2147483648,
|
||||||
"db_size": 2147483648,
|
|
||||||
"small_size": 16384,
|
"small_size": 16384,
|
||||||
"max_size": 134217728,
|
"max_size": 134217728,
|
||||||
"workers_number": 30
|
"workers_number": 30
|
||||||
|
|
|
@ -89,7 +89,6 @@ storage:
|
||||||
writecache:
|
writecache:
|
||||||
path: tmp/0/cache
|
path: tmp/0/cache
|
||||||
mem_size: 2147483648
|
mem_size: 2147483648
|
||||||
db_size: 2147483648
|
|
||||||
small_size: 16384
|
small_size: 16384
|
||||||
max_size: 134217728
|
max_size: 134217728
|
||||||
workers_number: 30
|
workers_number: 30
|
||||||
|
@ -121,7 +120,6 @@ storage:
|
||||||
writecache:
|
writecache:
|
||||||
path: tmp/1/cache
|
path: tmp/1/cache
|
||||||
mem_size: 2147483648
|
mem_size: 2147483648
|
||||||
db_size: 2147483648
|
|
||||||
small_size: 16384
|
small_size: 16384
|
||||||
max_size: 134217728
|
max_size: 134217728
|
||||||
workers_number: 30
|
workers_number: 30
|
||||||
|
|
|
@ -20,9 +20,6 @@ type options struct {
|
||||||
// maxMemSize is the maximum total size of all objects cached in memory.
|
// maxMemSize is the maximum total size of all objects cached in memory.
|
||||||
// 1 GiB by default.
|
// 1 GiB by default.
|
||||||
maxMemSize uint64
|
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 is the maximum size of the object stored in the write-cache.
|
||||||
maxObjectSize uint64
|
maxObjectSize uint64
|
||||||
// smallObjectSize is the maximum size of the object stored in the database.
|
// 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.
|
// WithMaxObjectSize sets maximum object size to be stored in write-cache.
|
||||||
func WithMaxObjectSize(sz uint64) Option {
|
func WithMaxObjectSize(sz uint64) Option {
|
||||||
return func(o *options) {
|
return func(o *options) {
|
||||||
|
|
Loading…
Reference in a new issue