forked from TrueCloudLab/frostfs-node
[#1753] services/tree: Add parent ID to the GetNodeByPath
response
Currently, you need to use `GetSubTree` to get parent, which seems an overkill. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
8a47f9ba12
commit
74c861342e
6 changed files with 4 additions and 1 deletions
|
@ -308,12 +308,13 @@ func (s *Service) GetNodeByPath(ctx context.Context, req *GetNodeByPathRequest)
|
|||
|
||||
info := make([]*GetNodeByPathResponse_Info, 0, len(nodes))
|
||||
for _, node := range nodes {
|
||||
m, _, err := s.forest.TreeGetMeta(cid, b.GetTreeId(), node)
|
||||
m, parent, err := s.forest.TreeGetMeta(cid, b.GetTreeId(), node)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var x GetNodeByPathResponse_Info
|
||||
x.ParentId = parent
|
||||
x.NodeId = node
|
||||
x.Timestamp = m.Time
|
||||
if b.AllAttributes {
|
||||
|
|
BIN
pkg/services/tree/service.pb.go
generated
BIN
pkg/services/tree/service.pb.go
generated
Binary file not shown.
|
@ -202,6 +202,8 @@ message GetNodeByPathResponse {
|
|||
uint64 timestamp = 2;
|
||||
// Node meta-information.
|
||||
repeated KeyValue meta = 3;
|
||||
// Parent ID.
|
||||
uint64 parent_id = 4;
|
||||
}
|
||||
message Body {
|
||||
// List of nodes stored by path.
|
||||
|
|
BIN
pkg/services/tree/service_grpc.pb.go
generated
BIN
pkg/services/tree/service_grpc.pb.go
generated
Binary file not shown.
BIN
pkg/services/tree/service_neofs.pb.go
generated
BIN
pkg/services/tree/service_neofs.pb.go
generated
Binary file not shown.
BIN
pkg/services/tree/types.pb.go
generated
BIN
pkg/services/tree/types.pb.go
generated
Binary file not shown.
Loading…
Reference in a new issue