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

dineshc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 1754ed1  HDDS-3692: Consider avoiding stream/map/sum in write hotpath 
(#1003)
1754ed1 is described below

commit 1754ed1c8ba8bfc7ecb40138874cc196760774fe
Author: rbalamohan <[email protected]>
AuthorDate: Tue Jun 2 09:04:06 2020 +0530

    HDDS-3692: Consider avoiding stream/map/sum in write hotpath (#1003)
---
 .../main/java/org/apache/hadoop/hdds/scm/storage/BufferPool.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BufferPool.java
 
b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BufferPool.java
index 410a9ac..d117edb 100644
--- 
a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BufferPool.java
+++ 
b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BufferPool.java
@@ -111,8 +111,11 @@ public class BufferPool {
   }
 
   public long computeBufferData() {
-    return bufferList.stream().mapToInt(ChunkBuffer::position)
-        .sum();
+    long totalBufferSize = 0;
+    for (ChunkBuffer buf : bufferList) {
+      totalBufferSize += buf.position();
+    }
+    return totalBufferSize;
   }
 
   public int getSize() {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to