Class TransferProgressUpdater
java.lang.Object
software.amazon.awssdk.transfer.s3.internal.progress.TransferProgressUpdater
An SDK-internal helper class that facilitates updating a
TransferProgress and invoking TransferListeners.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPublisherListener<software.amazon.awssdk.crt.s3.S3MetaRequestProgress> voidincrementBytesTransferred(long numBytes) Progress listener for Java-based S3Client with multipart enabled.progress()voidregisterCompletion(CompletableFuture<? extends CompletedObjectTransfer> future) voidwrapCrtResponseFileTransformer(AsyncResponseTransformer<GetObjectResponse, GetObjectResponse> responseTransformer) Wraps the response transformer used when the CRT-based S3 client writes the response body straight to a file.<ResultT> AsyncResponseTransformer<GetObjectResponse, ResultT> wrapForNonSerialFileDownload(AsyncResponseTransformer<GetObjectResponse, ResultT> responseTransformer, GetObjectRequest request) wrapRequestBody(AsyncRequestBody requestBody, boolean disableIncrementalProgress) Wraps the request body to track upload progress.<ResultT> AsyncResponseTransformer<GetObjectResponse, ResultT> wrapResponseTransformer(AsyncResponseTransformer<GetObjectResponse, ResultT> responseTransformer) <ResultT> AsyncResponseTransformer<GetObjectResponse, ResultT> wrapResponseTransformerForMultipartDownload(AsyncResponseTransformer<GetObjectResponse, ResultT> responseTransformer, GetObjectRequest request)
-
Constructor Details
-
TransferProgressUpdater
-
-
Method Details
-
progress
-
transferInitiated
public void transferInitiated() -
wrapRequestBody
public AsyncRequestBody wrapRequestBody(AsyncRequestBody requestBody, boolean disableIncrementalProgress) Wraps the request body to track upload progress.- Parameters:
requestBody- the original request bodydisableIncrementalProgress- whentrue, the wrapper will not report byte-level progress. This is used for in-memory byte bodies because all bytes are delivered to the publisher instantly and progress would jump to 100% before any data is sent over the wire.
-
multipartClientProgressListener
Progress listener for Java-based S3Client with multipart enabled.For multipart uploads, this is the primary source of progress since the wrapper body is bypassed by
splitCloseable. For single-chunk uploads viauploadInOneChunk, this listener reports progress after the server responds. -
crtProgressListener
-
wrapResponseTransformerForMultipartDownload
public <ResultT> AsyncResponseTransformer<GetObjectResponse,ResultT> wrapResponseTransformerForMultipartDownload(AsyncResponseTransformer<GetObjectResponse, ResultT> responseTransformer, GetObjectRequest request) -
wrapForNonSerialFileDownload
public <ResultT> AsyncResponseTransformer<GetObjectResponse,ResultT> wrapForNonSerialFileDownload(AsyncResponseTransformer<GetObjectResponse, ResultT> responseTransformer, GetObjectRequest request) -
wrapResponseTransformer
public <ResultT> AsyncResponseTransformer<GetObjectResponse,ResultT> wrapResponseTransformer(AsyncResponseTransformer<GetObjectResponse, ResultT> responseTransformer) -
wrapCrtResponseFileTransformer
public AsyncResponseTransformer<GetObjectResponse,GetObjectResponse> wrapCrtResponseFileTransformer(AsyncResponseTransformer<GetObjectResponse, GetObjectResponse> responseTransformer) Wraps the response transformer used when the CRT-based S3 client writes the response body straight to a file.Byte-level progress for that path is reported by
crtProgressListener()rather than by the response transformer, because no response body is ever delivered to the SDK. The transformer's publisher is also only subscribed to once the transfer has already finished, so unlikewrapResponseTransformer(AsyncResponseTransformer)this wrapper must neither reset nor increment the transferred byte count - doing so would discard the progress that CRT already reported. -
incrementBytesTransferred
public void incrementBytesTransferred(long numBytes) -
registerCompletion
-