From ba2c1bdd1906f9b2ca7195041ec3f00e899198c0 Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Wed, 23 Oct 2024 13:21:10 -0600 Subject: [PATCH] Rename IndexWriter.NextMerge() to GetNextMerge(), #986 --- src/Lucene.Net.TestFramework/Index/BaseMergePolicyTestCase.cs | 2 +- src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs | 2 +- src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs | 2 +- src/Lucene.Net/Index/ConcurrentMergeScheduler.cs | 4 ++-- src/Lucene.Net/Index/IndexWriter.cs | 2 +- src/Lucene.Net/Index/MergeScheduler.cs | 4 ++-- src/Lucene.Net/Index/SerialMergeScheduler.cs | 2 +- src/Lucene.Net/Support/Index/TaskMergeScheduler.cs | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Lucene.Net.TestFramework/Index/BaseMergePolicyTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseMergePolicyTestCase.cs index 08965c7e6d..0dd81a1e08 100644 --- a/src/Lucene.Net.TestFramework/Index/BaseMergePolicyTestCase.cs +++ b/src/Lucene.Net.TestFramework/Index/BaseMergePolicyTestCase.cs @@ -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(); } diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs index b8e5a6658b..bddcb786ea 100644 --- a/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs +++ b/src/Lucene.Net.Tests/Index/TestIndexWriterMerging.cs @@ -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; diff --git a/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs b/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs index a440a065e2..ef89731d66 100644 --- a/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs +++ b/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs @@ -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) { diff --git a/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs b/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs index 767e679a4f..43bcf98eba 100644 --- a/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs +++ b/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs @@ -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) @@ -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 diff --git a/src/Lucene.Net/Index/IndexWriter.cs b/src/Lucene.Net/Index/IndexWriter.cs index 829c7fcd57..443799b8d9 100644 --- a/src/Lucene.Net/Index/IndexWriter.cs +++ b/src/Lucene.Net/Index/IndexWriter.cs @@ -2680,7 +2680,7 @@ public virtual ICollection MergingSegments /// /// @lucene.experimental /// - public virtual MergePolicy.OneMerge NextMerge() // LUCENENET TODO: API - Revert name to GetNextMerge() to match Java + public virtual MergePolicy.OneMerge GetNextMerge() { UninterruptableMonitor.Enter(this); try diff --git a/src/Lucene.Net/Index/MergeScheduler.cs b/src/Lucene.Net/Index/MergeScheduler.cs index 694111ea28..cf4a6be8c3 100644 --- a/src/Lucene.Net/Index/MergeScheduler.cs +++ b/src/Lucene.Net/Index/MergeScheduler.cs @@ -41,7 +41,7 @@ protected MergeScheduler() } /// - /// Run the merges provided by . + /// Run the merges provided by . /// the to obtain the merges from. /// the that caused this merge to happen /// true iff any new merges were found by the caller; otherwise false @@ -66,4 +66,4 @@ public virtual object Clone() return (MergeScheduler)base.MemberwiseClone(); } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net/Index/SerialMergeScheduler.cs b/src/Lucene.Net/Index/SerialMergeScheduler.cs index 582a415f42..044b4ee856 100644 --- a/src/Lucene.Net/Index/SerialMergeScheduler.cs +++ b/src/Lucene.Net/Index/SerialMergeScheduler.cs @@ -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; diff --git a/src/Lucene.Net/Support/Index/TaskMergeScheduler.cs b/src/Lucene.Net/Support/Index/TaskMergeScheduler.cs index 9845937085..3fa597b863 100644 --- a/src/Lucene.Net/Support/Index/TaskMergeScheduler.cs +++ b/src/Lucene.Net/Support/Index/TaskMergeScheduler.cs @@ -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) @@ -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