vendredi 8 mai 2015

AWS S3 Java SDK: RequestClientOptions.setReadLimit

If we consider this S3 upload code

val tm: TransferManager = ???
val putRequest = new PutObjectRequest(bucketName, keyName, inputStream, metaData)
putRequest.setStorageClass(storageClass)
putRequest.getRequestClientOptions.setReadLimit(100000)
tm.upload(putRequest)

What is the use of the setReadLimit method? The AWS SDK Javadoc contains the following description:

Sets the optional mark-and-reset read limit used for signing and retry purposes. See Also: InputStream.mark(int)

Is my assumption correct in that it is to provide some kind of "checkpointing", such that if the network fails in the middle of an upload process, the API will (internally) perform a retry from the last "marked" position instead of from the beginning of the file?




Aucun commentaire:

Enregistrer un commentaire