简体   繁体   中英

How can I determine if an object is really available in s3?

When I upload to S3, I get it that I may have to wait for a while before it is downloadable. If I call "doesObjectExist" on an amazonS3 object, and it returns true, can I guarantee that it is downloadable everywhere, and not just from my own machine?

As long as the object never existed before, and as long as you don't do anything to try to check whether it exists prior to uploading it, it is guaranteed immediately available when the upload is complete. You do not have to wait at all after initial object creation as long as you have not tried in any way to access the nonexistent object.

In all other cases -- such as overwrites or cases where you try to read before write -- there is no way to verify with absolute certainty whether it will be subsequently accessible to all requesters, but a check like doesObjectExist gives you a reasonably good indication that the object is accessible. There is nothing special about your machine from one request to any subsequent request. You may or may not be talking to the same system components inside S3 across different requests, even if consecutive.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM