Refactor object building logic away from the GET service #124

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:feat/refactor_assemble into master 2023-07-26 21:07:56 +00:00
3 changed files with 1 additions and 14 deletions

View file

@ -115,7 +115,7 @@ func (exec execCtx) key() (*ecdsa.PrivateKey, error) {
}
func (exec *execCtx) canAssemble() bool {
return exec.svc.assembly && !exec.isRaw() && !exec.headOnly() && !exec.isLocal()
return !exec.isRaw() && !exec.headOnly() && !exec.isLocal()
}
func (exec *execCtx) splitInfo() *objectSDK.SplitInfo {

View file

@ -248,7 +248,6 @@ func TestGetLocalOnly(t *testing.T) {
svc := &Service{cfg: new(cfg)}
svc.log = test.NewLogger(false)
svc.localStorage = storage
svc.assembly = true
return svc
}
@ -510,7 +509,6 @@ func TestGetRemoteSmall(t *testing.T) {
svc := &Service{cfg: new(cfg)}
svc.log = test.NewLogger(false)
svc.localStorage = newTestStorage()
svc.assembly = true
const curEpoch = 13
@ -1644,7 +1642,6 @@ func TestGetFromPastEpoch(t *testing.T) {
svc := &Service{cfg: new(cfg)}
svc.log = test.NewLogger(false)
svc.localStorage = newTestStorage()
svc.assembly = true
const curEpoch = 13

View file

@ -26,8 +26,6 @@ type getClient interface {
}
type cfg struct {
assembly bool
log *logger.Logger
localStorage interface {
@ -51,7 +49,6 @@ type cfg struct {
func defaultCfg() *cfg {
return &cfg{
assembly: true,
log: &logger.Logger{Logger: zap.L()},
localStorage: new(storageEngineWrapper),
clientCache: new(clientCacheWrapper),
@ -79,13 +76,6 @@ func WithLogger(l *logger.Logger) Option {
}
}
// WithoutAssembly returns option to disable object assembling.
func WithoutAssembly() Option {
return func(c *cfg) {
c.assembly = false
}
}
// WithLocalStorageEngine returns option to set local storage
// instance.
func WithLocalStorageEngine(e *engine.StorageEngine) Option {