lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject [1/2] lucene-solr:master: LUCENE-8391: Make TestUpgradeIndexMergePolicy faster when merging a TieredMergePolicy.
Date Tue, 31 Jul 2018 19:33:47 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 4a86e00b7 -> 334bf498b
  refs/heads/master 1a870876c -> 96e985a34


LUCENE-8391: Make TestUpgradeIndexMergePolicy faster when merging a TieredMergePolicy.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/96e985a3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/96e985a3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/96e985a3

Branch: refs/heads/master
Commit: 96e985a3483f10537ea835a339f89dd10839dae3
Parents: 1a87087
Author: Adrien Grand <jpountz@gmail.com>
Authored: Tue Jul 31 21:31:56 2018 +0200
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Tue Jul 31 21:33:11 2018 +0200

----------------------------------------------------------------------
 .../org/apache/lucene/index/TestUpgradeIndexMergePolicy.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/96e985a3/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
b/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
index a2c6600..6df5cc8 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java
@@ -19,11 +19,17 @@ package org.apache.lucene.index;
 import java.io.IOException;
 
 import org.apache.lucene.index.MergePolicy.MergeSpecification;
+import org.apache.lucene.util.TestUtil;
 
 public class TestUpgradeIndexMergePolicy extends BaseMergePolicyTestCase {
 
   public MergePolicy mergePolicy() {
-    return new UpgradeIndexMergePolicy(newMergePolicy(random()));
+    MergePolicy in = newMergePolicy(random());
+    if (in instanceof TieredMergePolicy) {
+      // Avoid low values of the max merged segment size which prevent this merge policy
from scaling well
+      ((TieredMergePolicy) in).setMaxMergedSegmentMB(TestUtil.nextInt(random(), 1024, 10
* 1024));
+    }
+    return new UpgradeIndexMergePolicy(in);
   }
 
   @Override


Mime
View raw message