mikemccand commented on a change in pull request #1397: LUCENE-9304: Refactor
DWPTPool to pool DWPT directly
URL: https://github.com/apache/lucene-solr/pull/1397#discussion_r403702986
##########
File path:
lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java
##########
@@ -717,51 +664,49 @@ public InfoStream getInfoStream() {
return infoStream;
}
- synchronized ThreadState findLargestNonPendingWriter() {
- ThreadState maxRamUsingThreadState = null;
+ synchronized DocumentsWriterPerThread findLargestNonPendingWriter() {
+ DocumentsWriterPerThread maxRamUsingWriter = null;
long maxRamSoFar = 0;
- Iterator<ThreadState> activePerThreadsIterator = allActiveThreadStates();
+ Iterator<DocumentsWriterPerThread> activePerThreadsIterator =
perThreadPool.iterator();
int count = 0;
while (activePerThreadsIterator.hasNext()) {
- ThreadState next = activePerThreadsIterator.next();
- if (!next.flushPending) {
- final long nextRam = next.bytesUsed;
- if (nextRam > 0 && next.dwpt.getNumDocsInRAM() > 0) {
+ DocumentsWriterPerThread next = activePerThreadsIterator.next();
+ if (!next.isFlushPending()) {
+ final long nextRam = next.bytesUsed();
+ if (nextRam > 0 && next.getNumDocsInRAM() > 0) {
Review comment:
Hmm why would we ever have `nextRam > 0` but `next.getNumDocsInRAM() == `?
----------------------------------------------------------------
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]