Hi, i am back few more questions .Can some one tel...
# dev
s
Hi, i am back few more questions .Can some one tell me what
type WalkFunc func(id string) error
really does ? i am calling it under
walk
for each object ,but was unsure when it really comes in to play .I read the comments but got confused :( Another question around copy method
Copy(ctx context.Context, sourceObj, destinationObj ObjectPointer) error
.During s3 copy object does this really gets triggered or at the backend does it just do a
Get(ctx context.Context, obj ObjectPointer, expectedSize int64) (io.ReadCloser, error)
followed by a
Put(ctx context.Context, obj ObjectPointer, sizeBytes int64, reader io.Reader, opts PutOpts) error
?
b
hi sumesh The copy operation will be probably triggered when a request to S3 copy operation is invoked. There is a specific case where the protocol specify that we like to make copy as another object. So it depends on the client and the operation that performs the call.
Regarding the walk function. it is a way to perform listing using a callback - WalkFunc
There something specific that wasn't clear about how to implement it?
s
@Barak Amar thanks ,Amar .Regarding
Copy(
i initially thought the same but didnt really saw it getting called at any point . when some one does
s3api copy-object
seems like it just does
<https://github.com/treeverse/lakeFS/blob/master/pkg/gateway/operations/putobject.go#L78>
.Does it mean that it doesn’t really copy to the backend store but just creates an entry in API/db ?
b
You are right, the initial use of Copy was part of export where lakeFS cloud copy data from the underlying storage used by the adaptor to a path outside lakeFS usage. We kept the Copy interface/implementation as a valid option that we might use when supporting copy operation with different retention rules. The current implementation as you said, just copy the metadata and point to the same underlying storage, but it may not be kept the same for future cases.
👍 1