Skip to content

Commit

Permalink
object: Add INIT object type
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
carpawell committed Jan 23, 2024
1 parent cae99c9 commit c99aa08
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions object/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import "session/types.proto";
// * TOMBSTONE
// * STORAGE_GROUP
// * LOCK
// * INIT
enum ObjectType {
// Just a normal object
REGULAR = 0;
Expand All @@ -29,6 +30,9 @@ enum ObjectType {

// Object lock
LOCK = 3;

// Initialization part of the regular but split object
INIT = 4;
}

// Type of match expression
Expand Down Expand Up @@ -181,6 +185,8 @@ message Header {
// the same `split_id` value.
bytes split_id = 6 [json_name = "splitID"];

// Identifier of the initial part of the object split chain
neo.fs.v2.refs.ObjectID init = 7 [json_name = "init"];
}
// Position of the object in the split hierarchy
Split split = 11 [json_name = "split"];
Expand Down Expand Up @@ -222,4 +228,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;
}
3 changes: 3 additions & 0 deletions proto-docs/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,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 |


<a name="neo.fs.v2.object.Object"></a>
Expand Down Expand Up @@ -958,6 +959,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 |

<!-- end messages -->

Expand Down Expand Up @@ -996,6 +998,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 regular split object |


<!-- end enums -->
Expand Down

0 comments on commit c99aa08

Please sign in to comment.