Skip to content

Commit

Permalink
link: Add children sizes information
Browse files Browse the repository at this point in the history
It allows faster seeking through a split object without fetching the whole
chain.

Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
carpawell committed Jan 25, 2024
1 parent e448ccb commit 7b98b6a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Well-known `Version` node attribute (#267)
- `INIT` split chain object type (#283)
- Link object payload message (#263)
- Children sizes index to the link objects (#264)

### Removed
- Redundant object system attribute `__NEOFS__UPLOAD_ID` (#271)
Expand Down
20 changes: 15 additions & 5 deletions link/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ import "refs/types.proto";
// chain objects' IDs. It is created only after the whole split chain is known
// and signed. This object is the only object that refers to every "child object"
// ID. It is NOT required for the original object assembling. It MUST have ALL
// the "child objects" IDs. IDs MUST be ordered according to the original payload
// split, meaning the first payload part holder MUST be placed at the first place
// in the corresponding link object.
// the "child objects" IDs. Child objects MUST be ordered according to the
// original payload split, meaning the first payload part holder MUST be placed
// at the first place in the corresponding link object. Sizes MUST NOT be omitted
// and MUST be a real object payload size in bytes.
message Link {
// Full list of the "child" object IDs.
repeated neo.fs.v2.refs.ObjectID children = 1 [json_name = "children"];
// Object ID with its object's payload size.
message MeasuredObject {
// Object ID.
neo.fs.v2.refs.ObjectID id = 1 [json_name = "id"];

// Object size in bytes.
uint32 size = 2 [json_name = "size"];
}

// Full list of the "child" object descriptors.
repeated MeasuredObject children = 1 [json_name = "children"];
}
22 changes: 18 additions & 4 deletions proto-docs/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

- Messages
- [Link](#neo.fs.v2.link.Link)
- [Link.MeasuredObject](#neo.fs.v2.link.Link.MeasuredObject)


- [Scalar Value Types](#scalar-value-types)
Expand All @@ -29,14 +30,27 @@ Link is a payload of helper objects that contain the full list of the split
chain objects' IDs. It is created only after the whole split chain is known
and signed. This object is the only object that refers to every "child object"
ID. It is NOT required for the original object assembling. It MUST have ALL
the "child objects" IDs. IDs MUST be ordered according to the original payload
split, meaning the first payload part holder MUST be placed at the first place
in the corresponding link object.
the "child objects" IDs. Child objects MUST be ordered according to the
original payload split, meaning the first payload part holder MUST be placed
at the first place in the corresponding link object. Sizes MUST NOT be omitted
and MUST be a real object payload size in bytes.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Full list of the "child" object IDs. |
| children | [Link.MeasuredObject](#neo.fs.v2.link.Link.MeasuredObject) | repeated | Full list of the "child" object descriptors. |


<a name="neo.fs.v2.link.Link.MeasuredObject"></a>

### Message Link.MeasuredObject
Object ID with its object's payload size.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID. |
| size | [uint32](#uint32) | | Object size in bytes. |

<!-- end messages -->

Expand Down

0 comments on commit 7b98b6a

Please sign in to comment.