forked from TrueCloudLab/frostfs-node
[#1559] metabase: Remove public functions
Reduce public interface of this package. Later each result will contain an additional status, so it makes more sense to use the same functions and result processing everywhere. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
30c7925b3c
commit
f58234aa2f
31 changed files with 234 additions and 247 deletions
|
@ -50,15 +50,6 @@ func (p MovableRes) AddressList() []oid.Address {
|
|||
return p.addrList
|
||||
}
|
||||
|
||||
// ToMoveIt marks object to move it into another shard.
|
||||
func ToMoveIt(db *DB, addr oid.Address) error {
|
||||
var toMovePrm ToMoveItPrm
|
||||
toMovePrm.WithAddress(addr)
|
||||
|
||||
_, err := db.ToMoveIt(toMovePrm)
|
||||
return err
|
||||
}
|
||||
|
||||
// ToMoveIt marks objects to move it into another shard. This useful for
|
||||
// faster HRW fetching.
|
||||
func (db *DB) ToMoveIt(prm ToMoveItPrm) (res ToMoveItRes, err error) {
|
||||
|
@ -74,15 +65,6 @@ func (db *DB) ToMoveIt(prm ToMoveItPrm) (res ToMoveItRes, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// DoNotMove prevents the object to be moved into another shard.
|
||||
func DoNotMove(db *DB, addr oid.Address) error {
|
||||
var doNotMovePrm DoNotMovePrm
|
||||
doNotMovePrm.WithAddress(addr)
|
||||
|
||||
_, err := db.DoNotMove(doNotMovePrm)
|
||||
return err
|
||||
}
|
||||
|
||||
// DoNotMove removes `MoveIt` mark from the object.
|
||||
func (db *DB) DoNotMove(prm DoNotMovePrm) (res DoNotMoveRes, err error) {
|
||||
err = db.boltDB.Update(func(tx *bbolt.Tx) error {
|
||||
|
@ -97,16 +79,6 @@ func (db *DB) DoNotMove(prm DoNotMovePrm) (res DoNotMoveRes, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// Movable returns all movable objects of DB.
|
||||
func Movable(db *DB) ([]oid.Address, error) {
|
||||
r, err := db.Movable(MovablePrm{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return r.AddressList(), nil
|
||||
}
|
||||
|
||||
// Movable returns list of marked objects to move into other shard.
|
||||
func (db *DB) Movable(_ MovablePrm) (MovableRes, error) {
|
||||
var strAddrs []string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue