From 4910c4d2fa527cf96fec1498472acb87d2a8047e Mon Sep 17 00:00:00 2001 From: Jorge Esteban Quilcate Otoya Date: Thu, 12 Oct 2023 17:52:40 +0300 Subject: [PATCH] refactor: move metrics creation to constructor No need to keep this as class variable --- .../io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java b/storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java index 198c088ef..91728a62f 100644 --- a/storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java +++ b/storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java @@ -36,8 +36,6 @@ import com.google.cloud.storage.StorageOptions; public class GcsStorage implements StorageBackend { - private final MetricCollector metricCollector = new MetricCollector(); - private Storage storage; private String bucketName; private Integer resumableUploadChunkSize; @@ -48,7 +46,7 @@ public void configure(final Map configs) { this.bucketName = config.bucketName(); final StorageOptions.Builder builder = StorageOptions.newBuilder() .setCredentials(config.credentials()) - .setTransportOptions(metricCollector.httpTransportOptions()); + .setTransportOptions(new MetricCollector().httpTransportOptions()); if (config.endpointUrl() != null) { builder.setHost(config.endpointUrl()); }