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


##########
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:
   @Hexiaoqiao thanks for review. For this block, it's sort of modeled after 
other examples in DFSClient, such [as initializing the striped read thread 
pool](https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java#L3150).
 I think the idea is that DFSClient could easily be used in multiple threads, 
so we want to avoid double initializing the shared resource.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to