Alex Vanin
20de74a505
Due to source code relocation from GitHub. Signed-off-by: Alex Vanin <a.vanin@yadro.com>
19 lines
466 B
Go
19 lines
466 B
Go
package engine
|
|
|
|
import "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
|
|
|
|
// RestoreShard restores objects from dump to the shard with provided identifier.
|
|
//
|
|
// Returns an error if shard is not read-only.
|
|
func (e *StorageEngine) RestoreShard(id *shard.ID, prm shard.RestorePrm) error {
|
|
e.mtx.RLock()
|
|
defer e.mtx.RUnlock()
|
|
|
|
sh, ok := e.shards[id.String()]
|
|
if !ok {
|
|
return errShardNotFound
|
|
}
|
|
|
|
_, err := sh.Restore(prm)
|
|
return err
|
|
}
|