You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/11/16 15:40:16 UTC

[GitHub] [pinot] jadami10 commented on a diff in pull request #9710: [WIP] download offline segments from peers

jadami10 commented on code in PR #9710:
URL: https://github.com/apache/pinot/pull/9710#discussion_r1024166478


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/fetcher/SegmentFetcherFactory.java:
##########
@@ -196,4 +206,21 @@ private void fetchAndDecryptSegmentToLocalInternal(String uri, File dest, String
       crypter.decrypt(tempDownloadedFile, dest);
     }
   }
+
+  private void fetchAndDecryptSegmentToLocalInternal(@NonNull List<URI> uris, File dest, String crypterName)
+          throws Exception {
+    Preconditions.checkArgument(!uris.isEmpty(), "empty uris passed into the fetchAndDecryptSegmentToLocalInternal");
+    URI uri = uris.get(RANDOM.nextInt(uris.size()));

Review Comment:
   these are all the peer URIs, and you're randomly selecting one? If so, this feels like it should just live in the calling function to this. No need to duplicate the `fetch` functions here just to get a random selector in



##########
pinot-core/pom.xml:
##########
@@ -218,7 +218,7 @@
     </dependency>
     <dependency>
       <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
+      <artifactId>mockito-inline</artifactId>

Review Comment:
   was there something you needed from this that core couldn't achieve?



-- 
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-unsubscribe@pinot.apache.org

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


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