@@ -19,11 +19,52 @@ import aws.sdk.kotlin.services.s3.withConfig
1919 */
2020public class S3TransferManager private constructor(s3Client : S3Client , builder : Builder ) {
2121 public val client: S3Client = s3Client.withConfig { interceptors + = S3TransferManagerBusinessMetricInterceptor }
22+
23+ /* *
24+ * Preferred part size for multipart uploads.
25+ * If using this size would require more than 10,000 parts (the S3 limit),
26+ * the smallest possible part size that results in 10,000 parts is used instead.
27+ *
28+ * Default to 8,000,000 bytes.
29+ */
2230 public val partSizeBytes: Long = builder.partSizeBytes
31+
32+ /* *
33+ * Threshold size above which a file upload uses multipart upload
34+ * instead of a single put object request.
35+ *
36+ * Defaults to 16,000,000 bytes.
37+ */
2338 public val multipartUploadThresholdBytes: Long = builder.multipartUploadThresholdBytes
39+
40+ /* *
41+ * Strategy for multipart downloads, defined by [MultipartDownloadType].
42+ * Downloads can be performed either by specifying byte ranges or by requesting individual parts.
43+ *
44+ * Defaults to [Part].
45+ */
2446 public val multipartDownloadType: MultipartDownloadType = builder.multipartDownloadType
47+
48+ /* *
49+ * Mutable list of [TransferInterceptor]s, typically used to track transfers
50+ * or inspect/modify low-level S3 requests.
51+ */
2552 public val interceptors: MutableList <TransferInterceptor > = builder.interceptors
53+
54+ /* *
55+ * The maximum amount of parts to buffer in memory while waiting for uploads to complete.
56+ * The actual number of parts buffered at any given time may be less than or equal but never greater.
57+ *
58+ * Defaults to 5.
59+ */
2660 public val maxInMemoryParts: Int = builder.maxInMemoryParts
61+
62+ /* *
63+ * Maximum number of concurrent part uploads for a file.
64+ * The actual number of uploads at any given time may be less than or equal but never greater.
65+ *
66+ * Defaults to 5.
67+ */
2768 public val maxConcurrentPartUploads: Int = builder.maxConcurrentPartUploads
2869
2970 public companion object {
@@ -32,29 +73,60 @@ public class S3TransferManager private constructor(s3Client: S3Client, builder:
3273 }
3374
3475 public class Builder {
35- // TODO: K-docs for each one
76+ /* *
77+ * Preferred part size for multipart uploads.
78+ * If using this size would require more than 10,000 parts (the S3 limit),
79+ * the smallest possible part size that results in 10,000 parts is used instead.
80+ *
81+ * Default to 8,000,000 bytes.
82+ */
3683 public var partSizeBytes: Long = 8_000_000
84+
85+ /* *
86+ * Threshold size above which a file upload uses multipart upload
87+ * instead of a single put object request.
88+ *
89+ * Defaults to 16,000,000 bytes.
90+ */
3791 public var multipartUploadThresholdBytes: Long = 16_000_000L
92+
93+ /* *
94+ * Strategy for multipart downloads, defined by [MultipartDownloadType].
95+ * Downloads can be performed either by specifying byte ranges or by requesting individual parts.
96+ *
97+ * Defaults to [Part].
98+ */
3899 public var multipartDownloadType: MultipartDownloadType = Part
100+
101+ /* *
102+ * Mutable list of [TransferInterceptor]s, typically used to track transfers
103+ * or inspect/modify low-level S3 requests.
104+ */
39105 public var interceptors: MutableList <TransferInterceptor > = mutableListOf ()
106+
107+ /* *
108+ * The maximum amount of parts to buffer in memory while waiting for uploads to complete.
109+ * The actual number of parts buffered at any given time may be less than or equal but never greater.
110+ *
111+ * Defaults to 5.
112+ */
40113 public var maxInMemoryParts: Int = 5
114+
115+ /* *
116+ * Maximum number of concurrent part uploads for a file.
117+ * The actual number of uploads at any given time may be less than or equal but never greater.
118+ *
119+ * Defaults to 5.
120+ */
41121 public var maxConcurrentPartUploads: Int = 5
42122
43123 internal fun build (client : S3Client ): S3TransferManager =
44124 S3TransferManager (client, this )
45125 }
46126
47127 /* *
48- * Uploads a byte stream to Amazon S3, automatically using multipart uploads
49- * for large objects as needed.
50- *
51- * This function handles the complexity of splitting the data into parts,
52- * uploading each part, and completing the multipart upload. For object smaller than [multipartUploadThresholdBytes],
53- * a standard single-part upload is performed automatically.
54- *
55- * If the specified [partSizeBytes] for multipart uploads is too small to allow
56- * all parts to fit within S3's limit of 10,000 parts, the part size will be
57- * automatically increased so that exactly 10,000 parts are uploaded.
128+ * Uploads a file to S3 via [aws.smithy.kotlin.runtime.content.ByteStream].
129+ * Uses multipart uploads with concurrent uploads if the object size is more than the configured [multipartUploadThresholdBytes].
58130 */
59131 public suspend fun uploadFile (
60132 uploadFileRequest : UploadFileRequest ,
@@ -70,16 +142,8 @@ public class S3TransferManager private constructor(s3Client: S3Client, builder:
70142 )
71143
72144 /* *
73- * Uploads a byte stream to Amazon S3, automatically using multipart uploads
74- * for large objects as needed.
75- *
76- * This function handles the complexity of splitting the data into parts,
77- * uploading each part, and completing the multipart upload. For object smaller than [multipartUploadThresholdBytes],
78- * a standard single-part upload is performed automatically.
79- *
80- * If the specified [partSizeBytes] for multipart uploads is too small to allow
81- * all parts to fit within S3's limit of 10,000 parts, the part size will be
82- * automatically increased so that exactly 10,000 parts are uploaded.
145+ * Uploads a file to S3 via [aws.smithy.kotlin.runtime.content.ByteStream].
146+ * Uses multipart uploads with concurrent uploads if the object size is more than the configured [multipartUploadThresholdBytes].
83147 */
84148 public suspend inline fun uploadFile (
85149 crossinline block : UploadFileRequest .Builder .() -> Unit ,
0 commit comments