forked from TrueCloudLab/frostfs-node
[#1086] services/control: implement DumpShard
RPC
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
aa53418119
commit
0e60b1d6c9
9 changed files with 783 additions and 141 deletions
19
pkg/local_object_storage/engine/dump.go
Normal file
19
pkg/local_object_storage/engine/dump.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package engine
|
||||
|
||||
import "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard"
|
||||
|
||||
// DumpShard dumps objects from the shard with provided identifier.
|
||||
//
|
||||
// Returns an error if shard is not read-only.
|
||||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue