Skip to content

Commit 51977aa

Browse files
committed
Revert "PR 5164 remaining comments (#5403)"
This reverts commit b10c73e.
1 parent a52e476 commit 51977aa

File tree

7 files changed

+18
-29
lines changed

7 files changed

+18
-29
lines changed

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,6 @@ default SplitResult<ResponseT, ResultT> split(SplittingTransformerConfiguration
142142
.build();
143143
}
144144

145-
/**
146-
* Creates an {@link SplitResult} which contains an {@link SplittingTransformer} that splits the
147-
* {@link AsyncResponseTransformer} into multiple ones, publishing them as a {@link SdkPublisher}.
148-
*
149-
* @param splitConfig configuration for the split transformer
150-
* @return SplitAsyncResponseTransformer instance.
151-
* @see SplittingTransformer
152-
* @see SplitResult
153-
*/
154145
default SplitResult<ResponseT, ResultT> split(Consumer<SplittingTransformerConfiguration.Builder> splitConfig) {
155146
SplittingTransformerConfiguration conf = SplittingTransformerConfiguration.builder()
156147
.applyMutation(splitConfig)

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ public void exceptionOccurred(Throwable throwable) {
163163
}
164164
if (cf != null) {
165165
cf.completeExceptionally(throwable);
166-
} else {
167-
log.warn(() -> "An exception occurred before the call to prepare() was able to instantiate the CompletableFuture."
168-
+ "The future cannot be completed exceptionally because it is null");
169166
}
170167
}
171168

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ public void request(long n) {
155155
downstreamSubscriber.onError(new IllegalArgumentException("Amount requested must be positive"));
156156
return;
157157
}
158+
if (isCancelled.get()) {
159+
return;
160+
}
158161
long newDemand = outstandingDemand.updateAndGet(current -> {
159162
if (Long.MAX_VALUE - current < n) {
160163
return Long.MAX_VALUE;

core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncResponseTransformerTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import software.amazon.awssdk.core.FileTransformerConfiguration.FileWriteOption;
5353
import software.amazon.awssdk.core.FileTransformerConfiguration.FailureBehavior;
5454
import software.amazon.awssdk.core.async.SdkPublisher;
55+
import software.amazon.awssdk.core.util.FileUtils;
5556

5657
/**
5758
* Tests for {@link FileAsyncResponseTransformer}.
@@ -334,9 +335,9 @@ private static void stubException(String newContent, FileAsyncResponseTransforme
334335
transformer.onStream(SdkPublisher.adapt(Flowable.just(content, content)));
335336
transformer.exceptionOccurred(runtimeException);
336337

337-
assertThat(future).failsWithin(1, TimeUnit.SECONDS)
338-
.withThrowableOfType(ExecutionException.class)
339-
.withCause(runtimeException);
338+
assertThatThrownBy(() -> future.get(10, TimeUnit.SECONDS))
339+
.hasRootCause(runtimeException);
340+
assertThat(future.isCompletedExceptionally()).isTrue();
340341
}
341342

342343
private static SdkPublisher<ByteBuffer> testPublisher(String content) {

services-custom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/internal/utils/ResumableRequestConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private ResumableRequestConverter() {
9292
return Pair.of(originalDownloadRequest, responseTransformer);
9393
}
9494

95-
// ranged GET for the remaining bytes.
95+
// ranged GET for the remaining bytes (as a single request, no multipart)
9696
newDownloadFileRequest = resumedDownloadFileRequest(resumableFileDownload,
9797
originalDownloadRequest,
9898
getObjectRequest,

services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/multipart/DownloadObjectHelper.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,15 @@ private MultipartDownloaderSubscriber subscriber(GetObjectRequest getObjectReque
6363
}
6464

6565
private void logSinglePartMessage(GetObjectRequest getObjectRequest) {
66-
log.debug(() -> {
67-
String reason = "";
68-
if (getObjectRequest.range() != null) {
69-
reason = " because getObjectRequest range is included in the request."
70-
+ " range = " + getObjectRequest.range();
71-
} else if (getObjectRequest.partNumber() != null) {
72-
reason = " because getObjectRequest part number is included in the request."
73-
+ " part number = " + getObjectRequest.partNumber();
74-
}
75-
return "Using single part download" + reason;
76-
});
66+
String reason = "";
67+
if (getObjectRequest.range() != null) {
68+
reason = " because getObjectRequest range is included in the request."
69+
+ " range = " + getObjectRequest.range();
70+
} else if (getObjectRequest.partNumber() != null) {
71+
reason = " because getObjectRequest part number is included in the request."
72+
+ " part number = " + getObjectRequest.partNumber();
73+
}
74+
String finalReason = reason;
75+
log.debug(() -> "Using single part download" + finalReason);
7776
}
7877
}

services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/multipart/MultipartDownloadResumeContext.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ public int highestSequentialCompletedPart() {
108108
return 1;
109109
}
110110

111-
// for sequential operation, make sure we don't skip any non-completed part by returning the
112-
// highest sequentially completed part
113111
int previous = completedParts.first();
114112
for (Integer i : completedParts) {
115113
if (i - previous > 1) {

0 commit comments

Comments
 (0)