Merge pull request #54 from nspcc-dev/response-meta-header

Response meta header
This commit is contained in:
Evgeniy Kulikov 2020-02-14 11:02:54 +03:00 committed by GitHub
commit 9a98dffa62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 1 deletions

View file

@ -161,6 +161,10 @@ DeleteResponse is empty because we cannot guarantee permanent object removal
in distributed system.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) |
<a name="object.GetRangeHashRequest"></a>
@ -186,6 +190,7 @@ in distributed system.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Hashes | [bytes](#bytes) | repeated | Hashes is a homomorphic hashes of all ranges |
| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) |
<a name="object.GetRangeRequest"></a>
@ -211,6 +216,7 @@ in distributed system.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Fragment | [bytes](#bytes) | | Fragment of object's payload |
| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) |
<a name="object.GetRequest"></a>
@ -237,6 +243,7 @@ in distributed system.
| ----- | ---- | ----- | ----------- |
| object | [Object](#object.Object) | | Object header and some payload |
| Chunk | [bytes](#bytes) | | Chunk of remaining payload |
| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) |
<a name="object.HeadRequest"></a>
@ -263,6 +270,7 @@ in distributed system.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Object | [Object](#object.Object) | | Object without payload |
| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) |
<a name="object.PutRequest"></a>
@ -300,6 +308,7 @@ in distributed system.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) |
| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) |
<a name="object.SearchRequest"></a>
@ -326,6 +335,7 @@ in distributed system.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Addresses | [refs.Address](#refs.Address) | repeated | Addresses of found objects |
| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) |
<!-- end messages -->

View file

@ -7,6 +7,7 @@
- Messages
- [RequestMetaHeader](#service.RequestMetaHeader)
- [ResponseMetaHeader](#service.ResponseMetaHeader)
- [service/verify.proto](#service/verify.proto)
@ -49,6 +50,19 @@ RequestMetaHeader contains information about request meta headers
| Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value |
| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future |
<a name="service.ResponseMetaHeader"></a>
### Message ResponseMetaHeader
ResponseMetaHeader contains meta information based on request processing by server
(should be embedded into message)
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Epoch | [uint64](#uint64) | | Current NeoFS epoch on server |
| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future |
<!-- end messages -->
<!-- end enums -->

Binary file not shown.

View file

@ -73,6 +73,9 @@ message GetResponse {
// Chunk of remaining payload
bytes Chunk = 2;
}
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}
message PutRequest {
@ -99,6 +102,8 @@ message PutRequest {
message PutResponse {
// Address of object (container id + object id)
refs.Address Address = 1 [(gogoproto.nullable) = false];
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}
message DeleteRequest {
// Address of object (container id + object id)
@ -115,7 +120,10 @@ message DeleteRequest {
// DeleteResponse is empty because we cannot guarantee permanent object removal
// in distributed system.
message DeleteResponse {}
message DeleteResponse {
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}
message HeadRequest {
// Address of object (container id + object id)
@ -132,6 +140,8 @@ message HeadRequest {
message HeadResponse {
// Object without payload
Object Object = 1;
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}
message SearchRequest {
@ -150,6 +160,8 @@ message SearchRequest {
message SearchResponse {
// Addresses of found objects
repeated refs.Address Addresses = 1 [(gogoproto.nullable) = false];
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}
message GetRangeRequest {
@ -166,6 +178,8 @@ message GetRangeRequest {
message GetRangeResponse {
// Fragment of object's payload
bytes Fragment = 1;
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}
message GetRangeHashRequest {
@ -184,5 +198,7 @@ message GetRangeHashRequest {
message GetRangeHashResponse {
// Hashes is a homomorphic hashes of all ranges
repeated bytes Hashes = 1 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false];
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}

Binary file not shown.

View file

@ -18,3 +18,13 @@ message RequestMetaHeader {
// TODO: not used for now, should be implemented in future
uint32 Version = 3;
}
// ResponseMetaHeader contains meta information based on request processing by server
// (should be embedded into message)
message ResponseMetaHeader {
// Current NeoFS epoch on server
uint64 Epoch = 1;
// Version defines protocol version
// TODO: not used for now, should be implemented in future
uint32 Version = 2;
}