lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [05/10] lucenenet git commit: Adding TaskMergeScheduler as a case where it can randomly be set as MergeScheduler
Date Tue, 24 May 2016 21:22:58 GMT
Adding TaskMergeScheduler as a case where it can randomly be set as MergeScheduler


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/df83f077
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/df83f077
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/df83f077

Branch: refs/heads/analysis-work
Commit: df83f07706e653cf80dd61cda0c20dd21a838c03
Parents: 653d8a3
Author: Connie Yau <conniey@microsoft.com>
Authored: Mon May 2 16:48:56 2016 -0700
Committer: Connie Yau <conniey@microsoft.com>
Committed: Tue May 3 11:34:20 2016 -0700

----------------------------------------------------------------------
 .../Util/LuceneTestCase.cs                        | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/df83f077/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 6a217fb..83f17bd 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -872,9 +872,19 @@ namespace Lucene.Net.Util
             {
                 int maxThreadCount = TestUtil.NextInt(Random(), 1, 4);
                 int maxMergeCount = TestUtil.NextInt(Random(), maxThreadCount, maxThreadCount
+ 4);
-                ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
-                cms.SetMaxMergesAndThreads(maxMergeCount, maxThreadCount);
-                c.SetMergeScheduler(cms);
+                IConcurrentMergeScheduler mergeScheduler;
+
+                if (r.NextBoolean())
+                {
+                    mergeScheduler = new ConcurrentMergeScheduler();
+                }
+                else
+                {
+                    mergeScheduler = new TaskMergeScheduler();
+                }
+
+                mergeScheduler.SetMaxMergesAndThreads(maxMergeCount, maxThreadCount);
+                c.SetMergeScheduler(mergeScheduler);
             }
             if (r.NextBoolean())
             {
@@ -983,7 +993,7 @@ namespace Lucene.Net.Util
         public static LogMergePolicy NewLogMergePolicy(Random r)
         {
             LogMergePolicy logmp = r.NextBoolean() ? (LogMergePolicy)new LogDocMergePolicy()
: new LogByteSizeMergePolicy();
-            
+
             logmp.CalibrateSizeByDeletes = r.NextBoolean();
             if (Rarely(r))
             {


Mime
View raw message