[#229] blobovnicza: Store objects in a binary format

In previous implementation Blobovnicza's stored objects in protocol format
which did not allow working with externally compressed objects. To achieve
this goal, operations Get and Put no longer work with the structure of the
object, but only with abstract binary data. Operation GetRange has become
incorrect in its original purpose to receive the payload range. In this
regard, BlobStor receives the payload range of the object through Get
operation. In the future either Blobovnicza will learn to compress objects
by itself, or the GetRange operation will be eliminated.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-12-02 12:58:42 +03:00 committed by Alex Vanin
parent 3d77fdb347
commit eaae5a5dd7
6 changed files with 73 additions and 58 deletions

View file

@ -34,10 +34,12 @@ func (b *BlobStor) Put(prm *PutPrm) (*PutRes, error) {
return nil, errors.Wrap(err, "could not marshal the object")
}
if b.isBig(data) {
// compress object data
data = b.compressor(data)
big := b.isBig(data)
// compress object data
data = b.compressor(data)
if big {
// save object in shallow dir
return new(PutRes), b.fsTree.put(prm.obj.Address(), data)
} else {