Jackie-Jiang commented on code in PR #17241:
URL: https://github.com/apache/pinot/pull/17241#discussion_r2558041513


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -233,17 +233,26 @@ public 
PinotLLCRealtimeSegmentManager(PinotHelixResourceManager helixResourceMan
             helixResourceManager);
     _flushThresholdUpdateManager = new FlushThresholdUpdateManager();
     _isDeepStoreLLCSegmentUploadRetryEnabled = 
controllerConf.isDeepStoreRetryUploadLLCSegmentEnabled();
+    if (_isDeepStoreLLCSegmentUploadRetryEnabled != null && 
_isDeepStoreLLCSegmentUploadRetryEnabled) {
+      
enableDeepStoreSegmentUploadRetry(controllerConf.getDeepStoreRetryUploadParallelism());
+    }
     _isTmpSegmentAsyncDeletionEnabled = 
controllerConf.isTmpSegmentAsyncDeletionEnabled();
     _deepstoreUploadRetryTimeoutMs = 
controllerConf.getDeepStoreRetryUploadTimeoutMs();
-    _fileUploadDownloadClient = _isDeepStoreLLCSegmentUploadRetryEnabled ? 
initFileUploadDownloadClient() : null;
-    _deepStoreUploadExecutor = _isDeepStoreLLCSegmentUploadRetryEnabled ? 
Executors.newFixedThreadPool(
-        controllerConf.getDeepStoreRetryUploadParallelism()) : null;
-    _deepStoreUploadExecutorPendingSegments =
-        _isDeepStoreLLCSegmentUploadRetryEnabled ? 
ConcurrentHashMap.newKeySet() : null;
   }
 
-  public boolean isDeepStoreLLCSegmentUploadRetryEnabled() {
-    return _isDeepStoreLLCSegmentUploadRetryEnabled;
+  private void enableDeepStoreSegmentUploadRetry(int 
deepStoreRetryUploadParallelism) {
+    _fileUploadDownloadClient = initFileUploadDownloadClient();
+    _deepStoreUploadExecutor = 
Executors.newFixedThreadPool(deepStoreRetryUploadParallelism);
+    _deepStoreUploadExecutorPendingSegments = ConcurrentHashMap.newKeySet();
+  }
+
+  public boolean isDeepStoreLLCSegmentUploadRetryEnabled(boolean 
pauselessEnabled) {

Review Comment:
   This is anti-pattern. If we want to have this always enabled for pauseless, 
we should skip calling this method for pauseless table (always create the 
executor), instead of setting it as enabled which will also change the behavior 
of non-pauseless table



-- 
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