Skip to content
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

initiateMultipartUpload and completeMultipartUpload S3 methods #34

Merged
merged 1 commit into from
Apr 21, 2015

Conversation

onsails
Copy link
Contributor

@onsails onsails commented Apr 21, 2015

No description provided.

@dwhjames
Copy link
Owner

@prettynatty, I’m happy to accept this, but I would strongly recommend that you make use of TransferManager API rather than these lower level methods.

@onsails
Copy link
Contributor Author

onsails commented Apr 21, 2015

Not in my case - I need to use lower level methods to be able to upload file parts as single objects and then merge them using copyPartRequest: http://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingLLJavaMPUapi.html

@onsails
Copy link
Contributor Author

onsails commented Apr 21, 2015

Also added copyPart wrapper

@dwhjames
Copy link
Owner

@onsails
Copy link
Contributor Author

onsails commented Apr 21, 2015

This method returns immediately and does not allow validation (what if source does not exist?).

@dwhjames
Copy link
Owner

That exception would be captured by the Copy transfer object, right?

Sorry, I’m not intending to tell you how you should implement things. I’m just surprised and curious that what you are trying to do can’t be done with TransferManager. My impression was that that API enabled you do everything that could be done with respect to transfers, while taking care of multi-part uploads, and efficient use of threads and connections. So if there are gaps in its capabilities, I’m certainly interested.

@onsails
Copy link
Contributor Author

onsails commented Apr 21, 2015

Hmm, I see.

It's no problem to make such suggestions 😃 I'm pleased to listen them. I am just started learning S3 api.
I am implementing a service which generates pre-signed urls for uploading file parts (one url per part), wait after client uploads parts directly to S3 using these urls and then concatenate parts using copy method.
Seems like I can use TransferManager for everything except generating signed urls. That's good.
But I still need to call blocking waitForCopyResult method, right?

@dwhjames
Copy link
Owner

See
https://dwhjames.github.io/aws-wrap/doc/s3.html

/**
* A helper object providing a Scala Future interface for S3 Transfers.
*
* Transfers to and from S3 using the TransferManager provider a listener
* interface, and [[FutureTransfer.listenFor]] adapts this interface to
* Scala futures.
*
* @see [[http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/transfer/TransferManager.html TransferManager]]
* @see [[http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/transfer/Transfer.html Transfer]]
*/
object FutureTransfer {

with regards to blocking on transfers.

I have no experience with the pre-signed urls part, so maybe your use case requires direct use of the low-level API? I just try to avoid it in favor of using the higher-level transfer API, which is suppose to do a good job with respect to resource usage. And with the transfer listeners, it’s easy to bridge that into Scala Futures, which is what FutureTransfer.listenFor does.

@onsails
Copy link
Contributor Author

onsails commented Apr 21, 2015

Thank you, I'll play with TransferManager and FutureTransfer. But yes, I still need low-level api for generating pre-signed urls. Would you merge this pull request?

@dwhjames
Copy link
Owner

Would you merge this pull request?

Sure. Would you mind squashing your commits down to one in this case, as they are all closely related.

I’ll be able to publish a new release later today—I don’t have access to my software signing keys right at the moment.

@onsails
Copy link
Contributor Author

onsails commented Apr 21, 2015

Great! Squashed :shipit:

dwhjames added a commit that referenced this pull request Apr 21, 2015
initiateMultipartUpload and completeMultipartUpload S3 methods
@dwhjames dwhjames merged commit a157e66 into dwhjames:master Apr 21, 2015
@dwhjames
Copy link
Owner

Thanks for your PR. Best of luck with implementing your upload feature.

@dwhjames
Copy link
Owner

@prettynatty, this PR was released as part of v0.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants