[#1147] node: Use public fields for shard.ExistsPrm

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2024-05-30 09:26:06 +03:00 committed by Evgenii Stratonikov
parent c1af13b47e
commit 92e19feb57
9 changed files with 26 additions and 30 deletions

View file

@ -8,18 +8,16 @@ import (
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
)
func (e *StorageEngine) exists(ctx context.Context, addr oid.Address, parentAddr oid.Address) (bool, bool, error) {
var shPrm shard.ExistsPrm
shPrm.SetAddress(addr)
shPrm.SetParentAddress(parentAddr)
// exists return in the first value true if object exists.
// Second return value marks is parent object locked.
func (e *StorageEngine) exists(ctx context.Context, shPrm shard.ExistsPrm) (bool, bool, error) {
alreadyRemoved := false
exists := false
locked := false
e.iterateOverSortedShards(addr, func(_ int, sh hashedShard) (stop bool) {
e.iterateOverSortedShards(shPrm.Address, func(_ int, sh hashedShard) (stop bool) {
res, err := sh.Exists(ctx, shPrm)
if err != nil {
if client.IsErrObjectAlreadyRemoved(err) {