You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by di...@apache.org on 2020/06/02 03:34:16 UTC
[hadoop-ozone] branch master updated: HDDS-3692: Consider avoiding
stream/map/sum in write hotpath (#1003)
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 <rb...@apache.org>
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: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org