Skip to content

Commit

Permalink
Rename IndexWriter.NextMerge() to GetNextMerge(), #986
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Oct 23, 2024
1 parent 57dc5d4 commit ba2c1bd
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMer
UninterruptableMonitor.Enter(this);
try
{
if (!mayMerge.Value && writer.NextMerge() != null)
if (!mayMerge.Value && writer.GetNextMerge() != null)
{
throw AssertionError.Create();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMer
{
while (true)
{
MergePolicy.OneMerge merge = writer.NextMerge();
MergePolicy.OneMerge merge = writer.GetNextMerge();
if (merge is null)
{
break;
Expand Down
2 changes: 1 addition & 1 deletion src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private class ReportingMergeScheduler : MergeScheduler
public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound)
{
MergePolicy.OneMerge merge = null;
while ((merge = writer.NextMerge()) != null)
while ((merge = writer.GetNextMerge()) != null)
{
if (Verbose)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMer
}
}

MergePolicy.OneMerge merge = writer.NextMerge();
MergePolicy.OneMerge merge = writer.GetNextMerge();
if (merge is null)
{
if (IsVerbose)
Expand Down Expand Up @@ -691,7 +691,7 @@ public override void Run()

// Subsequent times through the loop we do any new
// merge that writer says is necessary:
merge = tWriter.NextMerge();
merge = tWriter.GetNextMerge();

// Notify here in case any threads were stalled;
// they will notice that the pending merge has
Expand Down
2 changes: 1 addition & 1 deletion src/Lucene.Net/Index/IndexWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,7 @@ public virtual ICollection<SegmentCommitInfo> MergingSegments
/// <para/>
/// @lucene.experimental
/// </summary>
public virtual MergePolicy.OneMerge NextMerge() // LUCENENET TODO: API - Revert name to GetNextMerge() to match Java
public virtual MergePolicy.OneMerge GetNextMerge()
{
UninterruptableMonitor.Enter(this);
try
Expand Down
4 changes: 2 additions & 2 deletions src/Lucene.Net/Index/MergeScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected MergeScheduler()
}

/// <summary>
/// Run the merges provided by <see cref="IndexWriter.NextMerge()"/>. </summary>
/// Run the merges provided by <see cref="IndexWriter.GetNextMerge()"/>. </summary>
/// <param name="writer"> the <see cref="IndexWriter"/> to obtain the merges from. </param>
/// <param name="trigger"> the <see cref="MergeTrigger"/> that caused this merge to happen </param>
/// <param name="newMergesFound"> <c>true</c> iff any new merges were found by the caller; otherwise <c>false</c>
Expand All @@ -66,4 +66,4 @@ public virtual object Clone()
return (MergeScheduler)base.MemberwiseClone();
}
}
}
}
2 changes: 1 addition & 1 deletion src/Lucene.Net/Index/SerialMergeScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMer
{
while (true)
{
MergePolicy.OneMerge merge = writer.NextMerge();
MergePolicy.OneMerge merge = writer.GetNextMerge();
if (merge is null)
{
break;
Expand Down
4 changes: 2 additions & 2 deletions src/Lucene.Net/Support/Index/TaskMergeScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMer
}
}

MergePolicy.OneMerge merge = writer.NextMerge();
MergePolicy.OneMerge merge = writer.GetNextMerge();
if (merge is null)
{
if (Verbose)
Expand Down Expand Up @@ -576,7 +576,7 @@ private void Run(CancellationToken cancellationToken)

// Subsequent times through the loop we do any new
// merge that writer says is necessary:
merge = _writer.NextMerge();
merge = _writer.GetNextMerge();

// Notify here in case any threads were stalled;
// they will notice that the pending merge has
Expand Down

0 comments on commit ba2c1bd

Please sign in to comment.