From 6bd0d99dddf70edd6cb43cf9bb4e2d19e30aabc4 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Feb 2020 13:38:53 +0300 Subject: [PATCH] make object.GetRange to be server-side streaming RPC --- object/service.proto | 11 ++++++----- proto-docs/object.md | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/object/service.proto b/object/service.proto index 4487a49..fb80e5d 100644 --- a/object/service.proto +++ b/object/service.proto @@ -42,9 +42,10 @@ service Service { // package). rpc Search(SearchRequest) returns (stream SearchResponse); - // GetRange of data payload. Ranges are set of pairs (offset, length). - // Fragments order in response corresponds to ranges order in request. - rpc GetRange(GetRangeRequest) returns (GetRangeResponse); + // GetRange of data payload. Range is a pair (offset, length). + // Requested range can be restored by concatenation of all chunks + // keeping receiving order. + rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); // GetRangeHash returns homomorphic hash of object payload range after XOR // operation. Ranges are set of pairs (offset, length). Hashes order in @@ -153,8 +154,8 @@ message SearchResponse { message GetRangeRequest { // Address of object (container id + object id) refs.Address Address = 1 [(gogoproto.nullable) = false]; - // Ranges of object's payload to return - repeated Range Ranges = 2 [(gogoproto.nullable) = false]; + // Range of object's payload to return + Range Range = 2 [(gogoproto.nullable) = false]; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/proto-docs/object.md b/proto-docs/object.md index f19b6f1..2d8de6f 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -64,7 +64,7 @@ rpc Put(stream PutRequest) returns (PutResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Head(HeadRequest) returns (HeadResponse); rpc Search(SearchRequest) returns (stream SearchResponse); -rpc GetRange(GetRangeRequest) returns (GetRangeResponse); +rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); ``` @@ -120,8 +120,7 @@ from all messages. Addresses from resulting list are expected to be unique. | Search | [SearchRequest](#object.SearchRequest) | [SearchResponse](#object.SearchResponse) | #### Method GetRange -GetRange of data payload. Ranges are set of pairs (offset, length). -Fragments order in response corresponds to ranges order in request. +GetRange of data payload. Range is a pair (offset, length). | Name | Input | Output | | ---- | ----- | ------ |