From fb6857a1cbc144724b73a597cd9138946dfece55 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 24 Nov 2020 16:29:55 +0300 Subject: [PATCH] [#211] blobstor: Rename Get operation to GetBig Signed-off-by: Leonard Lyubich --- .../blobstor/{get.go => get_big.go} | 22 +++++++++---------- pkg/local_object_storage/shard/get.go | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) rename pkg/local_object_storage/blobstor/{get.go => get_big.go} (70%) diff --git a/pkg/local_object_storage/blobstor/get.go b/pkg/local_object_storage/blobstor/get_big.go similarity index 70% rename from pkg/local_object_storage/blobstor/get.go rename to pkg/local_object_storage/blobstor/get_big.go index 94826b50f..91dc254c2 100644 --- a/pkg/local_object_storage/blobstor/get.go +++ b/pkg/local_object_storage/blobstor/get_big.go @@ -9,23 +9,23 @@ import ( "github.com/pkg/errors" ) -// GetPrm groups the parameters of Get operation. -type GetPrm struct { +// GetBigPrm groups the parameters of GetBig operation. +type GetBigPrm struct { addr *objectSDK.Address } -// GetRes groups resulting values of Get operation. -type GetRes struct { +// GetBigRes groups resulting values of GetBig operation. +type GetBigRes struct { obj *object.Object } // ErrObjectNotFound is returns on read operations requested on a missing object. var ErrObjectNotFound = errors.New("object not found") -// WithAddress is a Get option to set the address of the requested object. +// WithAddress is a GetBig option to set the address of the requested object. // // Option is required. -func (p *GetPrm) WithAddress(addr *objectSDK.Address) *GetPrm { +func (p *GetBigPrm) WithAddress(addr *objectSDK.Address) *GetBigPrm { if p != nil { p.addr = addr } @@ -34,15 +34,15 @@ func (p *GetPrm) WithAddress(addr *objectSDK.Address) *GetPrm { } // Object returns the requested object. -func (r *GetRes) Object() *object.Object { +func (r *GetBigRes) Object() *object.Object { return r.obj } -// Get reads the object from BLOB storage. +// GetBig reads the object from shallow dir of BLOB storage by address. // // Returns any error encountered that -// did not allow to completely read the object part. -func (b *BlobStor) Get(prm *GetPrm) (*GetRes, error) { +// did not allow to completely read the object. +func (b *BlobStor) GetBig(prm *GetBigPrm) (*GetBigRes, error) { b.mtx.RLock() defer b.mtx.RUnlock() @@ -67,7 +67,7 @@ func (b *BlobStor) Get(prm *GetPrm) (*GetRes, error) { return nil, errors.Wrap(err, "could not unmarshal the object") } - return &GetRes{ + return &GetBigRes{ obj: obj, }, nil } diff --git a/pkg/local_object_storage/shard/get.go b/pkg/local_object_storage/shard/get.go index 563e00d4e..fe72d43d0 100644 --- a/pkg/local_object_storage/shard/get.go +++ b/pkg/local_object_storage/shard/get.go @@ -77,8 +77,8 @@ func (s *Shard) Get(prm *GetPrm) (*GetRes, error) { if prm.ln < 0 { // try to read from WriteCache // TODO: implement - res, err := s.blobStor.Get( - new(blobstor.GetPrm). + res, err := s.blobStor.GetBig( + new(blobstor.GetBigPrm). WithAddress(prm.addr), ) if err != nil {