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 5, 2017
1 parent cc49744 commit eefe8b1
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 @@ -1382,7 +1382,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 eefe8b1

Please sign in to comment.