Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK committed Sep 5, 2024
1 parent aa7adbb commit de9c04b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public CRTJavaBenchmarkRunner(BenchmarkConfig config, String bucket, String regi
// If writing data to disk, enable backpressure.
// This prevents us from running out of memory due to downloading
// data faster than we can write it to disk.
if (config.filesOnDisk && Main.BACKPRESSURE_INITIAL_READ_WINDOW_MiB!=0) {
if (config.filesOnDisk && Main.BACKPRESSURE_INITIAL_READ_WINDOW_MiB != 0) {
s3ClientOpts.withReadBackpressureEnabled(true);
s3ClientOpts.withInitialReadWindowSize(Util.bytesFromMiB(Main.BACKPRESSURE_INITIAL_READ_WINDOW_MiB));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import software.amazon.awssdk.crt.http.HttpRequestBodyStream;
import software.amazon.awssdk.crt.s3.*;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.util.ArrayList;
Expand All @@ -24,7 +22,6 @@ class CRTJavaTask implements S3MetaRequestResponseHandler {
TaskConfig config;
S3MetaRequest metaRequest;
CompletableFuture<Void> doneFuture;
ReadableByteChannel uploadFileChannel;

CRTJavaTask(CRTJavaBenchmarkRunner runner, int taskI) {
this.runner = runner;
Expand Down Expand Up @@ -111,14 +108,6 @@ public void onFinished(S3FinishedResponseContext context) {
Util.exitWithError("S3MetaRequest failed");
} else {
// CRTJavaTask succeeded. Clean up...
try {
if (uploadFileChannel != null) {
uploadFileChannel.close();
}
} catch (IOException e) {
Util.exitWithError("Failed closing file: " + e.toString());
}

// work around API-gotcha where callbacks can fire on other threads
// before makeMetaRequest() has returned
synchronized (this) {
Expand Down

0 comments on commit de9c04b

Please sign in to comment.