From 53c32b413d95ad40f713140ca7b1378e5c99b7b6 Mon Sep 17 00:00:00 2001 From: Keith Laban Date: Wed, 5 Apr 2017 14:12:44 -0400 Subject: [PATCH] LUCENE-7671 - rename LiveUpgradeIndexMergePolicy to LiveUpgradeSegmentsMergePolicy --- .../org/apache/lucene/index/TestBackwardsCompatibility.java | 2 +- .../src/java/org/apache/lucene/index/IndexUpgrader.java | 2 +- ...MergePolicy.java => LiveUpgradeSegmentsMergePolicy.java} | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename lucene/core/src/java/org/apache/lucene/index/{LiveUpgradeIndexMergePolicy.java => LiveUpgradeSegmentsMergePolicy.java} (97%) diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java index 85c82e58e95b..0e3ed61f4e70 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java @@ -1409,7 +1409,7 @@ public void testUpgradeWithExplicitUpgrades() throws Exception { assertFalse("Excpected these segments to be an old version", versionBefore.equals(Version.LATEST)); - LiveUpgradeIndexMergePolicy uimp = new LiveUpgradeIndexMergePolicy(NoMergePolicy.INSTANCE); + LiveUpgradeSegmentsMergePolicy uimp = new LiveUpgradeSegmentsMergePolicy(NoMergePolicy.INSTANCE); assertEquals(numSegmentsBefore, checkAllSegmentsUpgraded(dir, versionBefore, createdVersionBefore)); diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexUpgrader.java b/lucene/core/src/java/org/apache/lucene/index/IndexUpgrader.java index 830f695a0588..67c07076fca5 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexUpgrader.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexUpgrader.java @@ -203,7 +203,7 @@ public void upgrade(int maxSegements) throws IOException { MergePolicy mp; if(includeNewSegments) { - LiveUpgradeIndexMergePolicy uimp = new LiveUpgradeIndexMergePolicy(iwc.getMergePolicy()); + LiveUpgradeSegmentsMergePolicy uimp = new LiveUpgradeSegmentsMergePolicy(iwc.getMergePolicy()); uimp.setEnableUpgrades(true); mp = uimp; } else { diff --git a/lucene/core/src/java/org/apache/lucene/index/LiveUpgradeIndexMergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/LiveUpgradeSegmentsMergePolicy.java similarity index 97% rename from lucene/core/src/java/org/apache/lucene/index/LiveUpgradeIndexMergePolicy.java rename to lucene/core/src/java/org/apache/lucene/index/LiveUpgradeSegmentsMergePolicy.java index 3d78bf792023..216049f63634 100644 --- a/lucene/core/src/java/org/apache/lucene/index/LiveUpgradeIndexMergePolicy.java +++ b/lucene/core/src/java/org/apache/lucene/index/LiveUpgradeSegmentsMergePolicy.java @@ -55,15 +55,15 @@ * @lucene.experimental * @see IndexUpgrader */ -public class LiveUpgradeIndexMergePolicy extends MergePolicyWrapper { +public class LiveUpgradeSegmentsMergePolicy extends MergePolicyWrapper { private int maxUpgradesAtATime = 5; private volatile boolean enableUpgrades = false; - private Predicate shouldSegmentUpgrade = LiveUpgradeIndexMergePolicy::segmentIsLatestVersion; + private Predicate shouldSegmentUpgrade = LiveUpgradeSegmentsMergePolicy::segmentIsLatestVersion; /** Wrap the given {@link MergePolicy} and intercept forceMerge requests to * only upgrade segments written with previous Lucene versions. */ - public LiveUpgradeIndexMergePolicy(MergePolicy in) { + public LiveUpgradeSegmentsMergePolicy(MergePolicy in) { super(in); }