s1monw commented on code in PR #12198:
URL: https://github.com/apache/lucene/pull/12198#discussion_r1136693360


##########
lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java:
##########
@@ -185,8 +185,12 @@ private boolean updatePeaks(long delta) {
     return true;
   }
 
-  DocumentsWriterPerThread doAfterDocument(DocumentsWriterPerThread perThread, 
boolean isUpdate) {
+  DocumentsWriterPerThread doAfterDocument(DocumentsWriterPerThread perThread) 
{
     final long delta = perThread.getCommitLastBytesUsedDelta();
+    if (flushPolicy.flushOnDocCount() == false && delta < 
flushPolicy.flushOnRAMGranularity()) {

Review Comment:
   ```suggestion
       // in order to prevent contention in the case of many threads indexing 
small documents 
       // we skip ram accounting unless the DWPT accumulated enough ram to be 
worthwhile
       if (flushPolicy.flushOnDocCount() == false && delta < 
flushPolicy.flushOnRAMGranularity()) {
   ```



##########
lucene/core/src/java/org/apache/lucene/index/FlushByRamOrCountsPolicy.java:
##########
@@ -95,14 +89,25 @@ protected void markLargestWriterPending(
     }
   }
 
-  /**
-   * Returns <code>true</code> if this {@link FlushPolicy} flushes on {@link
-   * IndexWriterConfig#getMaxBufferedDocs()}, otherwise <code>false</code>.
-   */
-  protected boolean flushOnDocCount() {
+  @Override
+  public boolean flushOnDocCount() {
     return indexWriterConfig.getMaxBufferedDocs() != 
IndexWriterConfig.DISABLE_AUTO_FLUSH;
   }
 
+  @Override
+  public long flushOnRAMGranularity() {

Review Comment:
   I don't think this needs to be an abstract method. I am not sure anyone 
users this interface at all except of tests and unless we override this method 
in a test I think it can be an impl detail of the only caller.



-- 
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: issues-unsubscr...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to