forked from TrueCloudLab/frostfs-node
[#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:
parent
3d77fdb347
commit
eaae5a5dd7
6 changed files with 73 additions and 58 deletions
|
@ -55,12 +55,15 @@ func testObject(sz uint64) *object.Object {
|
|||
}
|
||||
|
||||
func testPutGet(t *testing.T, blz *Blobovnicza, sz uint64, expPut, expGet error) *objectSDK.Address {
|
||||
// create new object
|
||||
obj := testObject(sz)
|
||||
// create binary object
|
||||
data := make([]byte, sz)
|
||||
|
||||
addr := testAddress()
|
||||
|
||||
// try to save object in Blobovnicza
|
||||
pPut := new(PutPrm)
|
||||
pPut.SetObject(obj)
|
||||
pPut.SetAddress(addr)
|
||||
pPut.SetMarshaledObject(data)
|
||||
_, err := blz.Put(pPut)
|
||||
require.True(t, errors.Is(err, expPut))
|
||||
|
||||
|
@ -68,12 +71,12 @@ func testPutGet(t *testing.T, blz *Blobovnicza, sz uint64, expPut, expGet error)
|
|||
return nil
|
||||
}
|
||||
|
||||
testGet(t, blz, obj.Address(), obj, expGet)
|
||||
testGet(t, blz, addr, data, expGet)
|
||||
|
||||
return obj.Address()
|
||||
return addr
|
||||
}
|
||||
|
||||
func testGet(t *testing.T, blz *Blobovnicza, addr *objectSDK.Address, expObj *object.Object, expErr error) {
|
||||
func testGet(t *testing.T, blz *Blobovnicza, addr *objectSDK.Address, expObj []byte, expErr error) {
|
||||
pGet := new(GetPrm)
|
||||
pGet.SetAddress(addr)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue