transformer: Simplify interface #110
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
pool
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#110
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-sdk-go:feat/refactor-transformer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Use simple
WriteObject
method to actually write object.Closes #64
@ -80,3 +67,1 @@
it.current.SetPayload(it.payload)
putSingleImplemented, err := it.tryPutSingle(ctx)
func (it *internalTarget) WriteObject(ctx context.Context, o *object.Object) (*transformer.AccessIdentifiers, error) {
Here we write a prepared object, do we need this
transformer.AccessIdentifiers
in the return value?No, fixed
@ -199,2 +179,3 @@
tt.current.SetPayload(tt.payload)
func (tt *testTarget) WriteObject(_ context.Context, o *objectSDK.Object) (*AccessIdentifiers, error) {
tt.current = o
tt.objects = append(tt.objects, tt.current)
So, it's just
tt.objects = append(tt.object, o)
? We set current tonil
afterwards.Oops, fixed
@ -25,1 +24,3 @@
type ObjectTarget interface {
// ObjectChunkWriter is an interface of the object writer
// that writes object chunked.
type ObjectChunkWriter interface {
UnpreparedObjectWriter
?I don't understand what does
Unprepared
mean?WriteHeader
requiresobjectSDK.Object
, so actually I have to prepare object to use this interface.Renamed to
ChunkedObjectWriter
, it looks closer to the truth.182afc2913
to272118af2c
@ -38,3 +21,1 @@
if len(c.payload) != 0 {
c.header.SetPayload(slice.Copy(c.payload))
}
func (c *chanTarget) WriteObject(ctx context.Context, o *objectSDK.Object) error {
Could you please put interface implementation check