snleee commented on code in PR #8845:
URL: https://github.com/apache/pinot/pull/8845#discussion_r891484288


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/fetcher/HttpSegmentFetcher.java:
##########
@@ -48,7 +50,10 @@ public void fetchSegmentToLocal(URI downloadURI, File dest)
     // Create a RoundRobinURIProvider to round robin IP addresses when retry 
uploading. Otherwise may always try to
     // download from a same broken host as: 1) DNS may not RR the IP addresses 
2) OS cache the DNS resolution result.
     RoundRobinURIProvider uriProvider = new RoundRobinURIProvider(downloadURI);
-    int retryCount = Math.max(_retryCount, uriProvider.numAddresses());

Review Comment:
   Let's use `Math.min()`.
   
   We already read `_retryCount` in `BaseSegmentFetcher` with the following 
line:
   ```
       _retryCount = config.getProperty(RETRY_COUNT_CONFIG_KEY, 
DEFAULT_RETRY_COUNT);
   
   ```



##########
pinot-common/src/main/java/org/apache/pinot/common/utils/fetcher/HttpSegmentFetcher.java:
##########
@@ -48,7 +50,10 @@ public void fetchSegmentToLocal(URI downloadURI, File dest)
     // Create a RoundRobinURIProvider to round robin IP addresses when retry 
uploading. Otherwise may always try to
     // download from a same broken host as: 1) DNS may not RR the IP addresses 
2) OS cache the DNS resolution result.
     RoundRobinURIProvider uriProvider = new RoundRobinURIProvider(downloadURI);
-    int retryCount = Math.max(_retryCount, uriProvider.numAddresses());

Review Comment:
   Let's use `Math.min()`.
   
   We already read `_retryCount` in `BaseSegmentFetcher` with the following 
line:
   ```
       _retryCount = config.getProperty(RETRY_COUNT_CONFIG_KEY, 
DEFAULT_RETRY_COUNT);
   ```



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