Skip to content

Commit b61019e

Browse files
committed
Deprecate split, update documentation and add changelog entries
1 parent 0c2000e commit b61019e

File tree

6 files changed

+38
-11
lines changed

6 files changed

+38
-11
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "deprecation",
3+
"category": "AWS SDK for Java v2",
4+
"contributor": "",
5+
"description": "Deprecate `AsyncRequestBody#split` in favor of `AsyncRequestBody#splitCloseable` that takes the same input but returns `SdkPublisher<CloseableAsyncRequestBody>`"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS SDK for Java v2",
4+
"contributor": "",
5+
"description": "Add `AsyncRequestBody#splitCloseable` API that returns a Publisher of `ClosableAsyncRequestBody`"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS SDK for Java v2",
4+
"contributor": "",
5+
"description": "Introduce CloseableAsyncRequestBody interface that extends both AsyncRequestBody and SdkAutoClosable interfaces"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS SDK for Java v2",
4+
"contributor": "",
5+
"description": "Introduce BufferedSplittableAsyncRequestBody that enables splitting into retryable sub-request bodies."
6+
}

core/sdk-core/src/main/java/software/amazon/awssdk/core/async/AsyncRequestBody.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,9 @@ static AsyncRequestBody empty() {
512512
* than or equal to {@code chunkSizeInBytes}. Note that this behavior may be different if a specific implementation of this
513513
* interface overrides this method.
514514
*
515-
* @see AsyncRequestBodySplitConfiguration
515+
* @deprecated use {@link #splitCloseable(AsyncRequestBodySplitConfiguration)} instead.
516516
*/
517+
@Deprecated
517518
default SdkPublisher<AsyncRequestBody> split(AsyncRequestBodySplitConfiguration splitConfiguration) {
518519
Validate.notNull(splitConfiguration, "splitConfiguration");
519520
return SplittingPublisher.builder()
@@ -537,6 +538,10 @@ default SdkPublisher<AsyncRequestBody> split(AsyncRequestBodySplitConfiguration
537538
* Caller is responsible for closing {@link CloseableAsyncRequestBody} when it is ready to be disposed to release any
538539
* resources.
539540
*
541+
* <p><b>Note:</b> This method is primarily intended for use by AWS SDK high-level libraries and internal components.
542+
* SDK customers should typically use higher-level APIs provided by service clients rather than calling this method directly.
543+
*
544+
* @see #splitCloseable(Consumer)
540545
* @see AsyncRequestBodySplitConfiguration
541546
*/
542547
default SdkPublisher<CloseableAsyncRequestBody> splitCloseable(AsyncRequestBodySplitConfiguration splitConfiguration) {
@@ -553,7 +558,9 @@ default SdkPublisher<CloseableAsyncRequestBody> splitCloseable(AsyncRequestBodyS
553558
* avoiding the need to create one manually via {@link AsyncRequestBodySplitConfiguration#builder()}.
554559
*
555560
* @see #split(AsyncRequestBodySplitConfiguration)
561+
* @deprecated use {@link #splitCloseable(Consumer)} instead
556562
*/
563+
@Deprecated
557564
default SdkPublisher<AsyncRequestBody> split(Consumer<AsyncRequestBodySplitConfiguration.Builder> splitConfiguration) {
558565
Validate.notNull(splitConfiguration, "splitConfiguration");
559566
return split(AsyncRequestBodySplitConfiguration.builder().applyMutation(splitConfiguration).build());
@@ -563,7 +570,10 @@ default SdkPublisher<AsyncRequestBody> split(Consumer<AsyncRequestBodySplitConfi
563570
* This is a convenience method that passes an instance of the {@link AsyncRequestBodySplitConfiguration} builder,
564571
* avoiding the need to create one manually via {@link AsyncRequestBodySplitConfiguration#builder()}.
565572
*
566-
* @see #splitCloseable(Consumer)
573+
* <p><b>Note:</b> This method is primarily intended for use by AWS SDK high-level libraries and internal components.
574+
* SDK customers should typically use higher-level APIs provided by service clients rather than calling this method directly.
575+
*
576+
* @see #splitCloseable(AsyncRequestBodySplitConfiguration)
567577
*/
568578
default SdkPublisher<CloseableAsyncRequestBody> splitCloseable(
569579
Consumer<AsyncRequestBodySplitConfiguration.Builder> splitConfiguration) {

core/sdk-core/src/main/java/software/amazon/awssdk/core/async/BufferedSplittableAsyncRequestBody.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,11 @@
3535
* subsequent retry attempts will fail since the complete data set is not available for resubscription.</p>
3636
*
3737
* <p><b>Usage Example:</b></p>
38-
* <pre>{@code
38+
* {@snippet :
3939
* AsyncRequestBody originalBody = AsyncRequestBody.fromString("Hello World");
4040
* BufferedSplittableAsyncRequestBody retryableBody =
4141
* BufferedSplittableAsyncRequestBody.create(originalBody);
42-
*
43-
* AsyncRequestBodySplitConfiguration config = AsyncRequestBodySplitConfiguration.builder()
44-
* .chunkSizeInBytes(1024)
45-
* .bufferSizeInBytes(2048)
46-
* .build();
47-
*
48-
* SdkPublisher<ClosableAsyncRequestBody> parts = retryableBody.splitClosable(config);
49-
* }</pre>
42+
* }
5043
*
5144
* <p><b>Performance Considerations:</b></p>
5245
* <p>This implementation buffers data in memory to enable retries, but memory usage is controlled by

0 commit comments

Comments
 (0)