forked from TrueCloudLab/frostfs-node
[#211] blobstor: Add SmallSizeLimit parameter
Add numeric parameter of maximum size of the "small" objects. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3028718691
commit
cfc770c3fe
1 changed files with 13 additions and 2 deletions
|
@ -22,6 +22,8 @@ type cfg struct {
|
||||||
compressor func([]byte) []byte
|
compressor func([]byte) []byte
|
||||||
|
|
||||||
decompressor func([]byte) ([]byte, error)
|
decompressor func([]byte) ([]byte, error)
|
||||||
|
|
||||||
|
smallSizeLimit uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -39,8 +41,9 @@ func defaultCfg() *cfg {
|
||||||
RootPath: "./",
|
RootPath: "./",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
compressor: noOpCompressor,
|
compressor: noOpCompressor,
|
||||||
decompressor: noOpDecompressor,
|
decompressor: noOpDecompressor,
|
||||||
|
smallSizeLimit: 1 << 20,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,3 +120,11 @@ func WithTreeRootPerm(perm os.FileMode) Option {
|
||||||
c.fsTree.Permissions = perm
|
c.fsTree.Permissions = perm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithSmallSizeLimit returns option to set maximum size of
|
||||||
|
// "small" object.
|
||||||
|
func WithSmallSizeLimit(lim uint64) Option {
|
||||||
|
return func(c *cfg) {
|
||||||
|
c.smallSizeLimit = lim
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue