From 0126a20a67eeb97934ec9c0436818d39879c9615 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 23 Jan 2024 20:42:59 +0300 Subject: [PATCH] object: Add `INIT` object type This object appears before any split chain is pushed to the network. It must contain the original object header (without the fields that are filled only after the whole payload is known) and be the original object's rights holder (e.g. to be an attribute-based ACL rule defendant). Signed-off-by: Pavel Karpy --- CHANGELOG.md | 1 + object/types.proto | 14 ++++++++++++++ proto-docs/object.md | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d998b0..6f4d862 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Added - Well-known `Version` node attribute (#267) +- `INIT` split chain object type (#283) ### Removed - Redundant object system attribute `__NEOFS__UPLOAD_ID` (#271) diff --git a/object/types.proto b/object/types.proto index 1d8a749..e6f8501 100644 --- a/object/types.proto +++ b/object/types.proto @@ -17,6 +17,7 @@ import "session/types.proto"; // * TOMBSTONE // * STORAGE_GROUP // * LOCK +// * INIT enum ObjectType { // Just a normal object REGULAR = 0; @@ -29,6 +30,9 @@ enum ObjectType { // Object lock LOCK = 3; + + // Initialization part of the split object + INIT = 4; } // Type of match expression @@ -181,6 +185,11 @@ message Header { // the same `split_id` value. bytes split_id = 6 [json_name = "splitID"]; + // Identifier of the initial part of the object split chain. Required for every + // split chain's objects (except the initial one). The initial object is the + // only original object's successor before the latest object part is uploaded to + // the network. + neo.fs.v2.refs.ObjectID init = 7 [json_name = "init"]; } // Position of the object in the split hierarchy Split split = 11 [json_name = "split"]; @@ -222,4 +231,9 @@ message SplitInfo { // split header with the original object header and a sorted list of // object parts. neo.fs.v2.refs.ObjectID link = 3; + + // The identifier of the initial object for split hierarchy parts. It contains + // zero payload and the original object (also known as a "parent") header in the + // `parent_header` field + neo.fs.v2.refs.ObjectID init_part = 4; } diff --git a/proto-docs/object.md b/proto-docs/object.md index 7913487..c08be90 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -953,6 +953,7 @@ must be within the same container. | parent_header | [Header](#neo.fs.v2.object.Header) | | `header` field of the parent object. Used to reconstruct parent. | | children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of identifiers of the objects generated by splitting current one. | | 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. | +| init | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the initial part of the object split chain. Required for every split chain's objects (except the initial one). The initial object is the only original object's successor before the latest object part is uploaded to the network. | @@ -1005,6 +1006,7 @@ right from the object parts. | split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. | | 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. | | 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. | +| init_part | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | The identifier of the initial object for split hierarchy parts. It contains zero payload and the original object (also known as a "parent") header in the `parent_header` field | @@ -1036,6 +1038,7 @@ String presentation of object type is the same as definition: * TOMBSTONE * STORAGE_GROUP * LOCK +* INIT | Name | Number | Description | | ---- | ------ | ----------- | @@ -1043,6 +1046,7 @@ String presentation of object type is the same as definition: | TOMBSTONE | 1 | Used internally to identify deleted objects | | STORAGE_GROUP | 2 | StorageGroup information | | LOCK | 3 | Object lock | +| INIT | 4 | Initialization part of the split object |