[#1523] blobstor: Rename compression.CConfig to Config

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-08-19 17:29:53 +03:00 committed by fyrchik
parent 0042c1d4a6
commit e8c6dce466
12 changed files with 34 additions and 34 deletions

View file

@ -48,11 +48,11 @@ import (
// B-s are intitialized and opened.
//
// Object is saved as follows:
// 1. at each level, according to HRW, the next one is selected and
// dives into it until we reach the deepest;
// 2. at the B-s level object is saved to the active B. If active B
// is full, next B is opened, initialized and cached. If there
// is no more X candidates, goto 1 and process next level.
// 1. at each level, according to HRW, the next one is selected and
// dives into it until we reach the deepest;
// 2. at the B-s level object is saved to the active B. If active B
// is full, next B is opened, initialized and cached. If there
// is no more X candidates, goto 1 and process next level.
//
// After the object is saved in B, path concatenation is returned
// in system path format as B identifier (ex. "0/1/1" or "3/2/1").
@ -228,6 +228,6 @@ func (b *Blobovniczas) Type() string {
}
// SetCompressor implements common.Storage.
func (b *Blobovniczas) SetCompressor(cc *compression.CConfig) {
b.CConfig = cc
func (b *Blobovniczas) SetCompressor(cc *compression.Config) {
b.compression = cc
}

View file

@ -132,7 +132,7 @@ func (b *Blobovniczas) getObject(blz *blobovnicza.Blobovnicza, prm blobovnicza.G
}
// decompress the data
data, err := b.Decompress(res.Object())
data, err := b.compression.Decompress(res.Object())
if err != nil {
return common.GetRes{}, fmt.Errorf("could not decompress object data: %w", err)
}

View file

@ -154,7 +154,7 @@ func (b *Blobovniczas) getObjectRange(blz *blobovnicza.Blobovnicza, prm common.G
}
// decompress the data
data, err := b.Decompress(res.Object())
data, err := b.compression.Decompress(res.Object())
if err != nil {
return common.GetRangeRes{}, fmt.Errorf("could not decompress object data: %w", err)
}

View file

@ -14,7 +14,7 @@ import (
func (b *Blobovniczas) Iterate(prm common.IteratePrm) (common.IterateRes, error) {
return common.IterateRes{}, b.iterateBlobovniczas(prm.IgnoreErrors, func(p string, blz *blobovnicza.Blobovnicza) error {
return blobovnicza.IterateObjects(blz, func(addr oid.Address, data []byte) error {
data, err := b.Decompress(data)
data, err := b.compression.Decompress(data)
if err != nil {
if prm.IgnoreErrors {
if prm.ErrorHandler != nil {

View file

@ -16,8 +16,8 @@ type cfg struct {
openedCacheSize int
blzShallowDepth uint64
blzShallowWidth uint64
*compression.CConfig
blzOpts []blobovnicza.Option
compression *compression.Config
blzOpts []blobovnicza.Option
}
type Option func(*cfg)

View file

@ -14,7 +14,7 @@ import (
// returns error if could not save object in any blobovnicza.
func (b *Blobovniczas) Put(prm common.PutPrm) (common.PutRes, error) {
if !prm.DontCompress {
prm.RawData = b.CConfig.Compress(prm.RawData)
prm.RawData = b.compression.Compress(prm.RawData)
}
var putPrm blobovnicza.PutPrm