Move target initialization for Put operation to common package #1310

Closed
opened 2024-08-13 13:39:19 +00:00 by aarifullin · 0 comments
Member

Patch method that was introduced in #1307 merges two streams (patches and intact original object payload chunks) into one. The result of patching is saved to FrostFS by using Put.

In this case, the save mechanism for Patch method must not differ from Put. That's why Patch currently uses a trick by initializing putStream using pkg/service/object/put/streamer.go and accessing target required for patcher initilazation (it recieves ObjectWriter) but this breaks encapsulation (see this discussion) to reach put mechanism consistency.

It is required to move target initialization for both PutStream and Patch to one common package and then reuse it:

  1. We'll save the encapsulation
  2. Put mechanism will be consistent between Put and Patch
`Patch` method that was introduced in [#1307](https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls/1307) merges two streams (patches and intact original object payload chunks) into one. The result of patching is saved to `FrostFS` by using `Put`. In this case, the save mechanism for `Patch` method must not differ from `Put`. That's why `Patch` currently uses a trick by initializing `putStream` using `pkg/service/object/put/streamer.go` and accessing target required for `patcher` initilazation (it recieves `ObjectWriter`) but this breaks encapsulation (see [this discussion](https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls/1307#issuecomment-47188)) to reach put mechanism consistency. It is required to move target initialization for both `PutStream` and `Patch` to one common package and then reuse it: 1. We'll save the encapsulation 2. Put mechanism will be consistent between `Put` and `Patch`
aarifullin added the
refactoring
blocked
labels 2024-08-13 13:39:19 +00:00
fyrchik added
good first issue
frostfs-node
internal
and removed
blocked
labels 2024-08-19 08:20:29 +00:00
fyrchik added this to the v0.43.0 milestone 2024-08-19 08:20:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#1310
No description provided.