-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make some changes to PutObjectStreaming() API #657
Make some changes to PutObjectStreaming() API #657
Conversation
bb44387
to
ad58937
Compare
This PR also fixes the bug #658 |
16dda0e
to
f1972e7
Compare
api-put-object-progress.go
Outdated
|
||
// If size cannot be found on a stream, it is not possible | ||
// to upload using streaming signature. | ||
if size < 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use multipart upload when we don't know the full size of the object?
- miniog-go calls NewMultipartUpload which doesn't require to know the size of the object
- minio-go tries to read at least 64MiB from io.Reader before it uploads the part.
- then CompleteMultipartUpload
We need to disable parallel uploads here, also resuming upload should be avoided which means we need to create a new upload id each time we call PutObjectStreaming.
We can do this in a separate PR since there is no API breakage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea will do, perhaps in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshavardhana we should close #607 once @vadmeste's comments are addressed. This PR fixes #658.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Detect size automatically like other PutObject() operations. - Allow progress bar to be passed into PutObjectStreaming(). - Allow also metadata to be passed into PutObjectStreaming(). - Rename NewStreamingV4 to just StreamingV4(). Keeping it consistent with other signature methods.
f1972e7
to
f9a324a
Compare
// If size cannot be found on a stream, it is not possible | ||
// to upload using streaming signature, fall back to multipart. | ||
if size < 0 { | ||
return c.putObjectMultipartStream(bucketName, objectName, reader, size, metadata, progress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshavardhana shouldn't we be using c.putObjectMultipartStreamNoChecksum
?
consistent with other signature methods.