You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2020/11/04 02:16:58 UTC

[james-project] 06/09: JAMES-3433 MetricableBlobStore should propagate storage strategy upon reads

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 52afff56094dda654929ac59c5a5e5e8f0a99a5d
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Nov 3 10:58:32 2020 +0700

    JAMES-3433 MetricableBlobStore should propagate storage strategy upon reads
---
 .../java/org/apache/james/blob/api/MetricableBlobStore.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/server/blob/blob-api/src/main/java/org/apache/james/blob/api/MetricableBlobStore.java b/server/blob/blob-api/src/main/java/org/apache/james/blob/api/MetricableBlobStore.java
index 309a20e..faea69d 100644
--- a/server/blob/blob-api/src/main/java/org/apache/james/blob/api/MetricableBlobStore.java
+++ b/server/blob/blob-api/src/main/java/org/apache/james/blob/api/MetricableBlobStore.java
@@ -70,6 +70,17 @@ public class MetricableBlobStore implements BlobStore {
     }
 
     @Override
+    public Publisher<byte[]> readBytes(BucketName bucketName, BlobId blobId, StoragePolicy storagePolicy) {
+        return metricFactory.decoratePublisherWithTimerMetric(READ_BYTES_TIMER_NAME, blobStoreImpl.readBytes(bucketName, blobId, storagePolicy));
+    }
+
+    @Override
+    public InputStream read(BucketName bucketName, BlobId blobId, StoragePolicy storagePolicy) {
+        return metricFactory
+            .decorateSupplierWithTimerMetric(READ_TIMER_NAME, () -> blobStoreImpl.read(bucketName, blobId, storagePolicy));
+    }
+
+    @Override
     public Publisher<Void> deleteBucket(BucketName bucketName) {
         return metricFactory.decoratePublisherWithTimerMetric(DELETE_BUCKET_TIMER_NAME, blobStoreImpl.deleteBucket(bucketName));
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org