[ 
https://issues.apache.org/jira/browse/HDFS-17364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17824398#comment-17824398
 ] 

ASF GitHub Bot commented on HDFS-17364:
---------------------------------------

Hexiaoqiao commented on code in PR #6514:
URL: https://github.com/apache/hadoop/pull/6514#discussion_r1516099526


##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/HdfsClientConfigKeys.java:
##########
@@ -530,6 +530,9 @@ interface StripedRead {
      * span 6 DNs, so this default value accommodates 3 read streams
      */
     int     THREADPOOL_SIZE_DEFAULT = 18;
+
+    String WEAK_REF_BUFFER_POOL_KEY = PREFIX + 
"bufferpool.weak.references.enabled";
+    boolean WEAK_REF_BUFFER_POOL_DEFAULT = false;

Review Comment:
   Please also add this default config to core-default.xml.



##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java:
##########
@@ -3159,6 +3165,21 @@ private void initThreadsNumForStripedReads(int 
numThreads) {
     }
   }
 
+  private void initBufferPoolForStripedReads(boolean useWeakReference) {
+    if (STRIPED_READ_BUFFER_POOL != null) {
+      return;
+    }
+    synchronized (DFSClient.class) {

Review Comment:
   What this `synchronized` would like to protect?





> Use WeakReferencedElasticByteBufferPool in DFSStripedInputStream
> ----------------------------------------------------------------
>
>                 Key: HDFS-17364
>                 URL: https://issues.apache.org/jira/browse/HDFS-17364
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Bryan Beaudreault
>            Priority: Major
>              Labels: pull-request-available
>
> DFSStripedInputStream uses ElasticByteBufferPool to allocate byte buffers for 
> the "curStripeBuf". This is used for non-positional (stateful) reads and is 
> allocated with a size of numDataBlocks * cellSize. For RS-6-3-1024k, that 
> means each DFSStripedInputStream could allocate a 6mb buffer. When the IS is 
> finished, the buffer is put back in the pool. Over time and with spikes of 
> concurrent reads, the pool grows and most of the buffers sit there unused.
>  
> WeakReferencedElasticByteBufferPool was introduced HADOOP-18105 and mitigates 
> this issue because the excess buffers can be GC'd once they are no longer 
> needed. We should use this same pool in DFSStripedInputStream



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to