这是我的代码
import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client;
public class AwsS3Helper { private AmazonS3 s3Client; public AwsS3Helper() { try { AWSCredentials credentials = new PropertiesCredentials .... s3Client = new AmazonS3Client( credentials ); s3Client.putObject(putObjectRequest);我想知道的是,这是异步还是同步操作? 我使用的是DynamoDB,它有2个不同的客户端,一个是异步和同步的,但是在Amazon SDK中没有看到任何其他的S3Client
Here is my code
import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client;
public class AwsS3Helper { private AmazonS3 s3Client; public AwsS3Helper() { try { AWSCredentials credentials = new PropertiesCredentials .... s3Client = new AmazonS3Client( credentials ); s3Client.putObject(putObjectRequest);What I would like to know is, is this an asynchronous or synchronous operation? I use DynamoDB and it has 2 different clients, an async and sync one, bu tI don't see any other S3Client in the Amazon SDK
最满意答案
该文档中的声明指向同步操作。 此外,它不会采用任何参数来表示结果的异步指示。
“Amazon S3从不存储部分对象;如果在此调用期间未抛出异常,则存储整个对象。” http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Client.html#putObject(com.amazonaws.services.s3.model.PutObjectRequest)
This statement, from the documentation is pointing to a synchronous operation. Moreover it doesnt take any parameter for asynch indication of the result.
"Amazon S3 never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored." http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Client.html#putObject(com.amazonaws.services.s3.model.PutObjectRequest)
更多推荐
发布评论