[#1388] blobstor: Drop unused

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-09-23 09:11:15 +03:00 committed by Dmitrii Stepanov
parent 63a567a1de
commit 004ff9e9bf
3 changed files with 9 additions and 24 deletions

View file

@ -16,5 +16,5 @@ func (s *memstoreImpl) Type() string { return Type }
func (s *memstoreImpl) Path() string { return s.rootPath } func (s *memstoreImpl) Path() string { return s.rootPath }
func (s *memstoreImpl) SetCompressor(cc *compression.Config) { s.compression = cc } func (s *memstoreImpl) SetCompressor(cc *compression.Config) { s.compression = cc }
func (s *memstoreImpl) Compressor() *compression.Config { return s.compression } func (s *memstoreImpl) Compressor() *compression.Config { return s.compression }
func (s *memstoreImpl) SetReportErrorFunc(f func(string, error)) { s.reportError = f } func (s *memstoreImpl) SetReportErrorFunc(func(string, error)) {}
func (s *memstoreImpl) SetParentID(string) {} func (s *memstoreImpl) SetParentID(string) {}

View file

@ -8,7 +8,6 @@ import (
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/common" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/common"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/internal/blobstortest" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/internal/blobstortest"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger/test"
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
@ -16,7 +15,6 @@ import (
func TestSimpleLifecycle(t *testing.T) { func TestSimpleLifecycle(t *testing.T) {
s := New( s := New(
WithRootPath("memstore"), WithRootPath("memstore"),
WithLogger(test.NewLogger(t)),
) )
defer func() { require.NoError(t, s.Close()) }() defer func() { require.NoError(t, s.Close()) }()
require.NoError(t, s.Open(mode.ComponentReadWrite)) require.NoError(t, s.Open(mode.ComponentReadWrite))

View file

@ -2,33 +2,20 @@ package memstore
import ( import (
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/compression" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/compression"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
"go.uber.org/zap"
) )
type cfg struct { type cfg struct {
log *logger.Logger
rootPath string rootPath string
readOnly bool readOnly bool
compression *compression.Config compression *compression.Config
reportError func(string, error)
} }
func defaultConfig() *cfg { func defaultConfig() *cfg {
return &cfg{ return &cfg{}
log: &logger.Logger{Logger: zap.L()},
reportError: func(string, error) {},
}
} }
type Option func(*cfg) type Option func(*cfg)
func WithLogger(l *logger.Logger) Option {
return func(c *cfg) {
c.log = l
}
}
func WithRootPath(p string) Option { func WithRootPath(p string) Option {
return func(c *cfg) { return func(c *cfg) {
c.rootPath = p c.rootPath = p