2022-01-24 10:13:37 +00:00
|
|
|
package engine
|
|
|
|
|
2023-03-07 13:38:26 +00:00
|
|
|
import "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
|
2022-01-24 10:13:37 +00:00
|
|
|
|
|
|
|
// DumpShard dumps objects from the shard with provided identifier.
|
|
|
|
//
|
2023-06-19 16:04:06 +00:00
|
|
|
// Returns an error if shard is not read-only or disabled.
|
2022-05-20 18:08:59 +00:00
|
|
|
func (e *StorageEngine) DumpShard(id *shard.ID, prm shard.DumpPrm) error {
|
2022-01-24 10:13:37 +00:00
|
|
|
e.mtx.RLock()
|
|
|
|
defer e.mtx.RUnlock()
|
|
|
|
|
|
|
|
sh, ok := e.shards[id.String()]
|
|
|
|
if !ok {
|
|
|
|
return errShardNotFound
|
|
|
|
}
|
|
|
|
|
|
|
|
_, err := sh.Dump(prm)
|
|
|
|
return err
|
|
|
|
}
|