forked from TrueCloudLab/frostfs-node
[#1548] engine: Rename parent -> ecParent
Parent could mean split parent or EC parent. In this case it is EC parent only. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
15139d80c9
commit
386a12eea4
4 changed files with 17 additions and 17 deletions
|
@ -20,8 +20,8 @@ import (
|
|||
|
||||
// ExistsPrm groups the parameters of Exists operation.
|
||||
type ExistsPrm struct {
|
||||
addr oid.Address
|
||||
paddr oid.Address
|
||||
addr oid.Address
|
||||
ecParentAddr oid.Address
|
||||
}
|
||||
|
||||
// ExistsRes groups the resulting values of Exists operation.
|
||||
|
@ -37,9 +37,9 @@ func (p *ExistsPrm) SetAddress(addr oid.Address) {
|
|||
p.addr = addr
|
||||
}
|
||||
|
||||
// SetParent is an Exists option to set objects parent.
|
||||
func (p *ExistsPrm) SetParent(addr oid.Address) {
|
||||
p.paddr = addr
|
||||
// SetECParent is an Exists option to set objects parent.
|
||||
func (p *ExistsPrm) SetECParent(addr oid.Address) {
|
||||
p.ecParentAddr = addr
|
||||
}
|
||||
|
||||
// Exists returns the fact that the object is in the metabase.
|
||||
|
@ -82,7 +82,7 @@ func (db *DB) Exists(ctx context.Context, prm ExistsPrm) (res ExistsRes, err err
|
|||
currEpoch := db.epochState.CurrentEpoch()
|
||||
|
||||
err = db.boltDB.View(func(tx *bbolt.Tx) error {
|
||||
res.exists, res.locked, err = db.exists(tx, prm.addr, prm.paddr, currEpoch)
|
||||
res.exists, res.locked, err = db.exists(tx, prm.addr, prm.ecParentAddr, currEpoch)
|
||||
|
||||
return err
|
||||
})
|
||||
|
@ -90,10 +90,10 @@ func (db *DB) Exists(ctx context.Context, prm ExistsPrm) (res ExistsRes, err err
|
|||
return res, metaerr.Wrap(err)
|
||||
}
|
||||
|
||||
func (db *DB) exists(tx *bbolt.Tx, addr oid.Address, parent oid.Address, currEpoch uint64) (bool, bool, error) {
|
||||
func (db *DB) exists(tx *bbolt.Tx, addr oid.Address, ecParent oid.Address, currEpoch uint64) (bool, bool, error) {
|
||||
var locked bool
|
||||
if !parent.Equals(oid.Address{}) {
|
||||
locked = objectLocked(tx, parent.Container(), parent.Object())
|
||||
if !ecParent.Equals(oid.Address{}) {
|
||||
locked = objectLocked(tx, ecParent.Container(), ecParent.Object())
|
||||
}
|
||||
// check graveyard and object expiration first
|
||||
st, err := objectStatus(tx, addr, currEpoch)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue