klsince commented on code in PR #15479:
URL: https://github.com/apache/pinot/pull/15479#discussion_r2033637829


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/BaseSegmentOperationsThrottler.java:
##########
@@ -92,6 +92,17 @@ public BaseSegmentOperationsThrottler(int maxConcurrency, 
int maxConcurrencyBefo
         availablePermits());
   }
 
+  /**
+   * The ServerMetrics may be created after these throttle objects are 
created. In that case, the initialization that
+   * happens in the constructor may have occurred on the NOOP metrics. This 
should be called after the server metrics
+   * are created and registered to ensure the correct metrics object is used 
and the metrics are updated correctly
+   */
+  public void initializeMetrics() {

Review Comment:
   nit: perhaps, so you can reuse this method in constructor too
   ```
   ... initializeMetrics(ServerMetrics serverMetrics) { 
    _serverMetrics=serverMetrics; 
    _serverMetrics.set...
    _serverMetrics.set...
   }
   ```
   
   I assume the constructor and the initializeMetrics methods would be called 
in one thread, so we don't have to make  _serverMetrics `volatile`, if so 
perhaps worth a comment that no need for `volatile` 



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to