Skip to content

Commit

Permalink
Add method
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Brooks committed Jun 8, 2023
1 parent 3d54150 commit 037518f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ public void flush(boolean force, boolean waitIfOngoing, ActionListener<FlushResu
// Only flush if (1) Lucene has uncommitted docs, or (2) forced by caller, or (3) the
// newly created commit points to a different translog generation (can free translog),
// or (4) the local checkpoint information in the last commit is stale, which slows down future recoveries.
boolean hasUncommittedChanges = indexWriter.hasUncommittedChanges();
boolean hasUncommittedChanges = hasUncommittedChanges();
if (hasUncommittedChanges
|| force
|| shouldPeriodicallyFlush()
Expand Down Expand Up @@ -2173,6 +2173,10 @@ public void flush(boolean force, boolean waitIfOngoing, ActionListener<FlushResu
waitForCommitDurability(generation, listener.map(v -> new FlushResult(true, generation)));
}

protected boolean hasUncommittedChanges() {
return indexWriter.hasUncommittedChanges();
}

private void refreshLastCommittedSegmentInfos() {
/*
* we have to inc-ref the store here since if the engine is closed by a tragic event
Expand Down

0 comments on commit 037518f

Please sign in to comment.