2022-09-07 09:11:06 +00:00
|
|
|
package tree
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-03-07 13:38:26 +00:00
|
|
|
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
2022-09-07 09:11:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// DropTree drops a tree from the database. If treeID is empty, all the trees are dropped.
|
2023-04-13 12:36:20 +00:00
|
|
|
func (s *Service) DropTree(ctx context.Context, cid cid.ID, treeID string) error {
|
2022-09-07 09:11:06 +00:00
|
|
|
// The only current use-case is a container removal, where all trees should be removed.
|
|
|
|
// Thus there is no need to replicate the operation on other node.
|
2023-04-13 12:36:20 +00:00
|
|
|
return s.forest.TreeDrop(ctx, cid, treeID)
|
2022-09-07 09:11:06 +00:00
|
|
|
}
|