Skip to content

Commit a825a7e

Browse files
committed
object: Use the first object part as a split ID
There is no need to generate some UUID with non-specified rules if the first object part allows the same identification routines but uses hashes widely accepted in the protocol. Signed-off-by: Pavel Karpy <[email protected]>
1 parent f816d8a commit a825a7e

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- `LINK` split chain object type (#283)
1010

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

1314
### Removed
1415

object/types.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,16 @@ message Header {
194194
// List of identifiers of the objects generated by splitting current one.
195195
repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"];
196196

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

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"];
202207
}
203208
// Position of the object in the split hierarchy
204209
Split split = 11 [json_name = "split"];
@@ -229,6 +234,8 @@ message Object {
229234
// assemble the original object. With a linking object one can assemble an object
230235
// right from the object parts.
231236
message SplitInfo {
237+
// DEPRECATED. Was used as an identifier of a split chain. Use the first
238+
// part ID instead.
232239
// 16 byte UUID used to identify the split object hierarchy parts.
233240
bytes split_id = 1;
234241

@@ -240,4 +247,8 @@ message SplitInfo {
240247
// split header with the original object header and a sorted list of
241248
// object parts.
242249
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;
243254
}

proto-docs/object.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,8 @@ must be within the same container.
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. |
957957
| 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) | | 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. |
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

0 commit comments

Comments
 (0)