From de9c04b0a1dcced308121284e5f9b9ae4336fa81 Mon Sep 17 00:00:00 2001 From: Dengke Date: Thu, 5 Sep 2024 13:55:49 -0700 Subject: [PATCH] format --- .../s3benchrunner/crtjava/CRTJavaBenchmarkRunner.java | 2 +- .../example/s3benchrunner/crtjava/CRTJavaTask.java | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner/crtjava/CRTJavaBenchmarkRunner.java b/runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner/crtjava/CRTJavaBenchmarkRunner.java index a84f0c64..d5c2d020 100644 --- a/runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner/crtjava/CRTJavaBenchmarkRunner.java +++ b/runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner/crtjava/CRTJavaBenchmarkRunner.java @@ -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)); } diff --git a/runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner/crtjava/CRTJavaTask.java b/runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner/crtjava/CRTJavaTask.java index b0cd1ebf..a0451a4b 100644 --- a/runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner/crtjava/CRTJavaTask.java +++ b/runners/s3-benchrunner-java/src/main/java/com/example/s3benchrunner/crtjava/CRTJavaTask.java @@ -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; @@ -24,7 +22,6 @@ class CRTJavaTask implements S3MetaRequestResponseHandler { TaskConfig config; S3MetaRequest metaRequest; CompletableFuture doneFuture; - ReadableByteChannel uploadFileChannel; CRTJavaTask(CRTJavaBenchmarkRunner runner, int taskI) { this.runner = runner; @@ -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) {