Skip to content

Commit 533950f

Browse files
Merge pull request #283 from nspcc-dev/fix/child-objects-acl
2 parents d5e1aad + a825a7e commit 533950f

File tree

5 files changed

+138
-3
lines changed

5 files changed

+138
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
### Added
66
- Numeric operands for object search queries (#265)
7+
- Link object payload message (#263)
8+
- Children sizes index to the link objects (#264)
9+
- `LINK` split chain object type (#283)
710

811
### Changed
12+
- Split ID is deprecated, the first child part is used instead and is known to the other parts (#283)
913

1014
### Removed
1115

link/types.proto

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
syntax = "proto3";
2+
3+
package neo.fs.v2.link;
4+
5+
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/link/grpc;link";
6+
option csharp_namespace = "Neo.FileStorage.API.Link";
7+
8+
import "refs/types.proto";
9+
10+
// Link is a payload of helper objects that contain the full list of the split
11+
// chain objects' IDs. It is created only after the whole split chain is known
12+
// and signed. This object is the only object that refers to every "child object"
13+
// ID. It is NOT required for the original object assembling. It MUST have ALL
14+
// the "child objects" IDs. Child objects MUST be ordered according to the
15+
// original payload split, meaning the first payload part holder MUST be placed
16+
// at the first place in the corresponding link object. Sizes MUST NOT be omitted
17+
// and MUST be a real object payload size in bytes.
18+
message Link {
19+
// Object ID with its object's payload size.
20+
message MeasuredObject {
21+
// Object ID.
22+
neo.fs.v2.refs.ObjectID id = 1 [json_name = "id"];
23+
24+
// Object size in bytes.
25+
uint32 size = 2 [json_name = "size"];
26+
}
27+
28+
// Full list of the "child" object descriptors.
29+
repeated MeasuredObject children = 1 [json_name = "children"];
30+
}

object/types.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import "session/types.proto";
1717
// * TOMBSTONE
1818
// * STORAGE_GROUP
1919
// * LOCK
20+
// * LINK
2021
enum ObjectType {
2122
// Just a normal object
2223
REGULAR = 0;
@@ -29,6 +30,9 @@ enum ObjectType {
2930

3031
// Object lock
3132
LOCK = 3;
33+
34+
// Object that stores child object IDs for the split objects.
35+
LINK = 4;
3236
}
3337

3438
// Type of match expression
@@ -185,14 +189,21 @@ message Header {
185189
// `header` field of the parent object. Used to reconstruct parent.
186190
Header parent_header = 4 [json_name = "parentHeader"];
187191

192+
// DEPRECATED. Was used before creating the separate LINK object type. Keep
193+
// child objects list in the LINK object's payload.
188194
// List of identifiers of the objects generated by splitting current one.
189195
repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"];
190196

197+
// DEPRECATED. Was used as an identifier of a split chain. Use the first
198+
// part ID instead.
191199
// 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be
192200
// unique inside container. All objects participating in the split must have
193201
// the same `split_id` value.
194202
bytes split_id = 6 [json_name = "splitID"];
195203

204+
// Identifier of the first part of the origin object. Known to all the split
205+
// parts except the first one. Identifies the split and allows to differ them.
206+
neo.fs.v2.refs.ObjectID first = 7 [json_name = "first"];
196207
}
197208
// Position of the object in the split hierarchy
198209
Split split = 11 [json_name = "split"];
@@ -223,6 +234,8 @@ message Object {
223234
// assemble the original object. With a linking object one can assemble an object
224235
// right from the object parts.
225236
message SplitInfo {
237+
// DEPRECATED. Was used as an identifier of a split chain. Use the first
238+
// part ID instead.
226239
// 16 byte UUID used to identify the split object hierarchy parts.
227240
bytes split_id = 1;
228241

@@ -234,4 +247,8 @@ message SplitInfo {
234247
// split header with the original object header and a sorted list of
235248
// object parts.
236249
neo.fs.v2.refs.ObjectID link = 3;
250+
251+
// Identifier of the first part of the origin object. Known to all the split
252+
// parts except the first one. Identifies the split and allows to differ them.
253+
neo.fs.v2.refs.ObjectID first_part = 4;
237254
}

proto-docs/link.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Protocol Documentation
2+
<a name="top"></a>
3+
4+
## Table of Contents
5+
6+
- [link/types.proto](#link/types.proto)
7+
8+
- Messages
9+
- [Link](#neo.fs.v2.link.Link)
10+
- [Link.MeasuredObject](#neo.fs.v2.link.Link.MeasuredObject)
11+
12+
13+
- [Scalar Value Types](#scalar-value-types)
14+
15+
16+
17+
<a name="link/types.proto"></a>
18+
<p align="right"><a href="#top">Top</a></p>
19+
20+
## link/types.proto
21+
22+
23+
<!-- end services -->
24+
25+
26+
<a name="neo.fs.v2.link.Link"></a>
27+
28+
### Message Link
29+
Link is a payload of helper objects that contain the full list of the split
30+
chain objects' IDs. It is created only after the whole split chain is known
31+
and signed. This object is the only object that refers to every "child object"
32+
ID. It is NOT required for the original object assembling. It MUST have ALL
33+
the "child objects" IDs. Child objects MUST be ordered according to the
34+
original payload split, meaning the first payload part holder MUST be placed
35+
at the first place in the corresponding link object. Sizes MUST NOT be omitted
36+
and MUST be a real object payload size in bytes.
37+
38+
39+
| Field | Type | Label | Description |
40+
| ----- | ---- | ----- | ----------- |
41+
| children | [Link.MeasuredObject](#neo.fs.v2.link.Link.MeasuredObject) | repeated | Full list of the "child" object descriptors. |
42+
43+
44+
<a name="neo.fs.v2.link.Link.MeasuredObject"></a>
45+
46+
### Message Link.MeasuredObject
47+
Object ID with its object's payload size.
48+
49+
50+
| Field | Type | Label | Description |
51+
| ----- | ---- | ----- | ----------- |
52+
| id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID. |
53+
| size | [uint32](#uint32) | | Object size in bytes. |
54+
55+
<!-- end messages -->
56+
57+
<!-- end enums -->
58+
59+
60+
61+
## Scalar Value Types
62+
63+
| .proto Type | Notes | C++ Type | Java Type | Python Type |
64+
| ----------- | ----- | -------- | --------- | ----------- |
65+
| <a name="double" /> double | | double | double | float |
66+
| <a name="float" /> float | | float | float | float |
67+
| <a name="int32" /> int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int |
68+
| <a name="int64" /> int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long |
69+
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long |
70+
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long |
71+
| <a name="sint32" /> sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int |
72+
| <a name="sint64" /> sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long |
73+
| <a name="fixed32" /> fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int |
74+
| <a name="fixed64" /> fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long |
75+
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int |
76+
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long |
77+
| <a name="bool" /> bool | | bool | boolean | boolean |
78+
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode |
79+
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str |
80+

proto-docs/object.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,9 @@ must be within the same container.
954954
| previous | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the left split neighbor |
955955
| parent_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `signature` field of the parent object. Used to reconstruct parent. |
956956
| parent_header | [Header](#neo.fs.v2.object.Header) | | `header` field of the parent object. Used to reconstruct parent. |
957-
| children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of identifiers of the objects generated by splitting current one. |
958-
| split_id | [bytes](#bytes) | | 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be unique inside container. All objects participating in the split must have the same `split_id` value. |
957+
| children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | DEPRECATED. Was used before creating the separate LINK object type. Keep child objects list in the LINK object's payload. List of identifiers of the objects generated by splitting current one. |
958+
| split_id | [bytes](#bytes) | | DEPRECATED. Was used as an identifier of a split chain. Use the first part ID instead. 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be unique inside container. All objects participating in the split must have the same `split_id` value. |
959+
| first | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the first part of the origin object. Known to all the split parts except the first one. Identifies the split and allows to differ them. |
959960

960961

961962
<a name="neo.fs.v2.object.Object"></a>
@@ -1005,9 +1006,10 @@ right from the object parts.
10051006

10061007
| Field | Type | Label | Description |
10071008
| ----- | ---- | ----- | ----------- |
1008-
| split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. |
1009+
| split_id | [bytes](#bytes) | | DEPRECATED. Was used as an identifier of a split chain. Use the first part ID instead. 16 byte UUID used to identify the split object hierarchy parts. |
10091010
| last_part | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | The identifier of the last object in split hierarchy parts. It contains split header with the original object header. |
10101011
| link | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | The identifier of a linking object for split hierarchy parts. It contains split header with the original object header and a sorted list of object parts. |
1012+
| first_part | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the first part of the origin object. Known to all the split parts except the first one. Identifies the split and allows to differ them. |
10111013

10121014
<!-- end messages -->
10131015

@@ -1043,13 +1045,15 @@ String presentation of object type is the same as definition:
10431045
* TOMBSTONE
10441046
* STORAGE_GROUP
10451047
* LOCK
1048+
* LINK
10461049

10471050
| Name | Number | Description |
10481051
| ---- | ------ | ----------- |
10491052
| REGULAR | 0 | Just a normal object |
10501053
| TOMBSTONE | 1 | Used internally to identify deleted objects |
10511054
| STORAGE_GROUP | 2 | StorageGroup information |
10521055
| LOCK | 3 | Object lock |
1056+
| LINK | 4 | Object that stores child object IDs for the split objects. |
10531057

10541058

10551059
<!-- end enums -->

0 commit comments

Comments
 (0)