drcrallen commented on a change in pull request #7174: Change reservoir 
sampling of segments to spliterator approach
URL: https://github.com/apache/incubator-druid/pull/7174#discussion_r262696189
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/server/coordinator/ReservoirSegmentSampler.java
 ##########
 @@ -21,36 +21,57 @@
 
 import org.apache.druid.timeline.DataSegment;
 
+import java.util.Collection;
 import java.util.List;
+import java.util.Spliterator;
 import java.util.concurrent.ThreadLocalRandom;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
 
 final class ReservoirSegmentSampler
 {
+  final static int SPLITERATOR_SIZE_THRESHOLD = 10;
 
 Review comment:
   did you include stats tests here? there are random components at play so you 
can't claim most uniform without a measure for the randomness :)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to