frostfs-node/pkg/local_object_storage/engine/dump.go
Dmitrii Stepanov 1cae03c47c [#452] engine: Set Disabled mode to deleted shard
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-06-19 19:04:06 +03:00

19 lines
455 B
Go

package engine
import "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
// DumpShard dumps objects from the shard with provided identifier.
//
// Returns an error if shard is not read-only or disabled.
func (e *StorageEngine) DumpShard(id *shard.ID, prm shard.DumpPrm) error {
e.mtx.RLock()
defer e.mtx.RUnlock()
sh, ok := e.shards[id.String()]
if !ok {
return errShardNotFound
}
_, err := sh.Dump(prm)
return err
}