vsop-479 commented on PR #15823:
URL: https://github.com/apache/lucene/pull/15823#issuecomment-4133149036

   > Java 8+ users: several common uses for this class are now more 
comprehensively addressed by the new Stream library. Read the method 
documentation below for comparisons. This class is not being deprecated, but we 
gently encourage you to migrate to streams.
   
   OK, Stream is also encouraged by Guava.
   
   So we can add a method `#addAll(Collection<S> elements, Function<S, T> 
elementTransformer)` and use `elements.stream().map(elementTransformer)` to 
filter in it, or `#addAll(Stream<T> stream)` and let the caller to filter or 
not but need removing the size validation.
   
   
   > we don't know size before so allocation may be harder and ineffective.
   
   I am a bit confused about why the size of elements affects PQ's allocation, 
does not PQ allcated according to its `maxSize`?


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