Use streams to marshal/unmarshal object's payload #849

Open
opened 2023-12-07 06:46:41 +00:00 by acid-ant · 2 comments
Member

Problem

In scope of 1338 introduced new argument '--binary' which help us to serialize object structure.
But we need a way to avoid store whole payload in memory to use Marshal/Unmarhsal methods.

Solution

It is preferable to use streams of bytes.

Let's also think about being forwards and/or backwards compatible with the next API versions.

Related to https://github.com/nspcc-dev/neofs-node/issues/1932

Places, where we need to improve:

objToStore.SetPayload(payloadBuffer.Bytes())


commonCmd.ExitOnErr(cmd, "can't unmarshal object from given file: %w", objTemp.Unmarshal(buf))

**Problem** In scope of [1338](https://github.com/nspcc-dev/neofs-node/issues/1338) introduced new argument '--binary' which help us to serialize object structure. But we need a way to avoid store whole payload in memory to use Marshal/Unmarhsal methods. **Solution** It is preferable to use streams of bytes. Let's also think about being forwards and/or backwards compatible with the next API versions. Related to https://github.com/nspcc-dev/neofs-node/issues/1932 Places, where we need to improve: https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/a478050639aac5bb144f5d41b366e26c8956e3c0/cmd/frostfs-cli/modules/object/get.go#L112 https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/a478050639aac5bb144f5d41b366e26c8956e3c0/cmd/frostfs-cli/modules/object/put.go#L160
acid-ant added the
triage
label 2023-12-07 06:46:41 +00:00
Owner

TBH I would rather drop the whole binary feature, it seems unused and storing big objects as --binary actually creates new object, which couldn't be put without further processing (this was the whole motivation behind --binary).

TBH I would rather drop the whole binary feature, it seems unused and storing big objects as `--binary` actually creates new object, which _couldn't be put_ without further processing (this was the whole motivation behind `--binary`).
Author
Member

TBH I would rather drop the whole binary feature

How about storing set of objects - link, part1, part2...?

> TBH I would rather drop the whole binary feature How about storing set of objects - link, part1, part2...?
fyrchik added
frostfs-cli
discussion
and removed
triage
labels 2023-12-08 07:36:51 +00:00
fyrchik added this to the v0.38.0 milestone 2023-12-22 07:23:04 +00:00
fyrchik modified the milestone from v0.38.0 to v0.39.0 2024-02-12 06:26:40 +00:00
fyrchik modified the milestone from v0.39.0 to vNext 2024-05-14 14:10:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#849
No description provided.