Skip to content

Commit

Permalink
LUCENE-7671 - rename LiveUpgradeIndexMergePolicy to LiveUpgradeSegmen…
Browse files Browse the repository at this point in the history
…tsMergePolicy
  • Loading branch information
kelaban committed Apr 7, 2017
1 parent b211742 commit 53c32b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SegmentCommitInfo> shouldSegmentUpgrade = LiveUpgradeIndexMergePolicy::segmentIsLatestVersion;
private Predicate<SegmentCommitInfo> 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);
}

Expand Down

0 comments on commit 53c32b4

Please sign in to comment.