From 02bf1c75393426c2b7aa53a80612fea9b796413f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 15 Feb 2024 22:00:33 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20post-p?= =?UTF-8?q?rocessor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- README.md | 6 ++--- .../cloud/storage/benchmarking/Bidi.java | 26 +++++++++--------- .../StorageSharedBenchmarkingCli.java | 27 ++++++++++--------- .../cloud/storage/benchmarking/W1R3.java | 4 ++- 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 1bfe56831a..8c0440db41 100644 --- a/README.md +++ b/README.md @@ -57,13 +57,13 @@ implementation 'com.google.cloud:google-cloud-storage' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-storage:2.33.0' +implementation 'com.google.cloud:google-cloud-storage:2.34.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.33.0" +libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.34.0" ``` @@ -428,7 +428,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-storage.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.33.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.34.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/Bidi.java b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/Bidi.java index 2375d7f8d2..f4a528ba29 100644 --- a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/Bidi.java +++ b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/Bidi.java @@ -18,15 +18,11 @@ import static com.google.cloud.storage.benchmarking.StorageSharedBenchmarkingUtils.generateCloudMonitoringResult; -import com.google.cloud.storage.Blob; import com.google.cloud.storage.BlobInfo; import com.google.cloud.storage.BlobWriteSession; -import com.google.cloud.storage.Bucket; -import com.google.cloud.storage.BucketInfo; import com.google.cloud.storage.DataGenerator; import com.google.cloud.storage.Storage; import com.google.cloud.storage.Storage.BlobWriteOption; -import com.google.cloud.storage.it.runner.registry.Generator; import java.io.PrintWriter; import java.nio.ByteBuffer; import java.nio.channels.WritableByteChannel; @@ -34,7 +30,6 @@ import java.time.Duration; import java.time.Instant; import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; class Bidi implements Callable { private final Storage storageClient; @@ -44,7 +39,13 @@ class Bidi implements Callable { private final String api; private final int workers; - Bidi(Storage storageClient, String bucketName, int objectSize, PrintWriter pw, String api, int workers) { + Bidi( + Storage storageClient, + String bucketName, + int objectSize, + PrintWriter pw, + String api, + int workers) { this.storageClient = storageClient; this.bucketName = bucketName; this.objectSize = objectSize; @@ -58,8 +59,7 @@ public String call() throws Exception { String blobName = DataGenerator.base64Characters().genBytes(20).toString(); BlobWriteSession sess = storageClient.blobWriteSession( - BlobInfo.newBuilder(bucketName, blobName).build(), - BlobWriteOption.doesNotExist()); + BlobInfo.newBuilder(bucketName, blobName).build(), BlobWriteOption.doesNotExist()); byte[] bytes = DataGenerator.base64Characters().genBytes(objectSize); Clock clock = Clock.systemDefaultZone(); Instant startTime = clock.instant(); @@ -76,10 +76,12 @@ public String call() throws Exception { private void printResult(String op, BlobInfo created, Duration duration) { pw.println( generateCloudMonitoringResult( - op, - StorageSharedBenchmarkingUtils.calculateThroughput( - created.getSize().doubleValue(), duration), - created, api, workers) + op, + StorageSharedBenchmarkingUtils.calculateThroughput( + created.getSize().doubleValue(), duration), + created, + api, + workers) .formatAsCustomMetric()); } } diff --git a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java index b44ed1d133..836c28d01e 100644 --- a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java +++ b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java @@ -20,10 +20,8 @@ import com.google.api.core.ListenableFutureToApiFuture; import com.google.api.gax.retrying.RetrySettings; import com.google.cloud.storage.BlobWriteSessionConfigs; -import com.google.cloud.storage.DataGenerator; import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; -import com.google.cloud.storage.it.runner.registry.Generator; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; @@ -161,10 +159,11 @@ private void runWorkload1DirectPath() { } private void runWorkloadBidi() { - StorageOptions options = StorageOptions.grpc() - .setProjectId(project) - .setBlobWriteSessionConfig(BlobWriteSessionConfigs.bidiWrite()) - .build(); + StorageOptions options = + StorageOptions.grpc() + .setProjectId(project) + .setBlobWriteSessionConfig(BlobWriteSessionConfigs.bidiWrite()) + .build(); Storage storageClient = options.getService(); try { runBidi(storageClient); @@ -175,10 +174,11 @@ private void runWorkloadBidi() { } private void runWorkloadNoBidi() { - StorageOptions options = StorageOptions.grpc() - .setProjectId(project) - .setBlobWriteSessionConfig(BlobWriteSessionConfigs.getDefault()) - .build(); + StorageOptions options = + StorageOptions.grpc() + .setProjectId(project) + .setBlobWriteSessionConfig(BlobWriteSessionConfigs.getDefault()) + .build(); Storage storageClient = options.getService(); try { runBidi(storageClient); @@ -213,10 +213,13 @@ private void runW1R3(Storage storageClient) throws ExecutionException, Interrupt private void runBidi(Storage storageClient) throws ExecutionException, InterruptedException { ListeningExecutorService executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(workers)); - for(int i = 0; i < samples; i++) { + for (int i = 0; i < samples; i++) { Range objectSizeRange = Range.of(objectSize); int objectSize = getRandomInt(objectSizeRange.min, objectSizeRange.max); - convert(executorService.submit(new Bidi(storageClient, bucket, objectSize, printWriter, api, workers))).get(); + convert( + executorService.submit( + new Bidi(storageClient, bucket, objectSize, printWriter, api, workers))) + .get(); } } diff --git a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java index cce2258e56..3fe436b124 100644 --- a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java +++ b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java @@ -112,7 +112,9 @@ private void printResult(String op, Blob created, Duration duration) { op, StorageSharedBenchmarkingUtils.calculateThroughput( created.getSize().doubleValue(), duration), - created.asBlobInfo(), api, workers) + created.asBlobInfo(), + api, + workers) .formatAsCustomMetric()); } }