anmolanmol1234 commented on code in PR #7832:
URL: https://github.com/apache/hadoop/pull/7832#discussion_r2459660348


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/ReadBufferManagerV2.java:
##########
@@ -87,17 +111,53 @@ static ReadBufferManagerV2 getBufferManager() {
   }
 
   /**
-   * {@inheritDoc}
+   * Set the ReadBufferManagerV2 configurations based on the provided before 
singleton initialization.
+   * @param readAheadBlockSize the read-ahead block size to set for the 
ReadBufferManagerV2.
+   * @param abfsConfiguration the configuration to set for the 
ReadBufferManagerV2.
+   */
+  public static void setReadBufferManagerConfigs(final int readAheadBlockSize,
+      final AbfsConfiguration abfsConfiguration) {
+    // Set Configs only before initializations.
+    if (bufferManager == null && !isConfigured) {
+      minThreadPoolSize = abfsConfiguration.getMinReadAheadV2ThreadPoolSize();
+      maxThreadPoolSize = abfsConfiguration.getMaxReadAheadV2ThreadPoolSize();
+      cpuMonitoringIntervalInMilliSec = 
abfsConfiguration.getReadAheadV2CpuMonitoringIntervalMillis();
+      cpuThreshold = 
abfsConfiguration.getReadAheadV2CpuUsageThresholdPercent()/ ONE_HUNDRED;
+      threadPoolUpscalePercentage = 
abfsConfiguration.getReadAheadV2ThreadPoolUpscalePercentage();
+      threadPoolDownscalePercentage = 
abfsConfiguration.getReadAheadV2ThreadPoolDownscalePercentage();
+      executorServiceKeepAliveTimeInMilliSec = 
abfsConfiguration.getReadAheadExecutorServiceTTLInMillis();
+
+      minBufferPoolSize = abfsConfiguration.getMinReadAheadV2BufferPoolSize();

Review Comment:
   As discussed earlier this should start with 8 threads which is the default 
in trunk today and can scale further 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to