From 4a4c56b99d1ab8066d1f3408edff90a30cabf7bd Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 22 May 2012 23:27:27 +0000 Subject: [PATCH] LUCENE-4055: remove redundant parameter git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4055@1341680 13f79535-47bb-0310-9956-ffa450edef68 --- .../core/src/java/org/apache/lucene/index/IndexWriter.java | 4 ++-- .../src/java/org/apache/lucene/index/SegmentMerger.java | 6 ++---- lucene/core/src/test/org/apache/lucene/index/TestDoc.java | 2 +- .../src/test/org/apache/lucene/index/TestSegmentMerger.java | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java index 3e097d8be6b..d0a7aac2246 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java @@ -2294,7 +2294,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit { codec, null, null); SegmentMerger merger = new SegmentMerger(info, infoStream, trackingDir, config.getTermIndexInterval(), - mergedName, MergeState.CheckAbort.NONE, payloadProcessorProvider, + MergeState.CheckAbort.NONE, payloadProcessorProvider, new FieldInfos.Builder(globalFieldNumberMap), codec, context); for (IndexReader reader : readers) { // add new indexes @@ -3438,7 +3438,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit { final MergeState.CheckAbort checkAbort = new MergeState.CheckAbort(merge, directory); final TrackingDirectoryWrapper dirWrapper = new TrackingDirectoryWrapper(directory); - SegmentMerger merger = new SegmentMerger(merge.info.info, infoStream, dirWrapper, config.getTermIndexInterval(), mergedName, checkAbort, + SegmentMerger merger = new SegmentMerger(merge.info.info, infoStream, dirWrapper, config.getTermIndexInterval(), checkAbort, payloadProcessorProvider, new FieldInfos.Builder(globalFieldNumberMap), codec, context); if (infoStream.isEnabled("IW")) { diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java b/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java index a22bdcc2735..d1a2e730a6a 100644 --- a/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java +++ b/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java @@ -46,7 +46,6 @@ import org.apache.lucene.util.ReaderUtil; */ final class SegmentMerger { private final Directory directory; - private final String segment; private final int termIndexInterval; private final Codec codec; @@ -58,7 +57,7 @@ final class SegmentMerger { // nocommit nuke name since SI has it.... but Directory is // NOT the same!! - SegmentMerger(SegmentInfo segmentInfo, InfoStream infoStream, Directory dir, int termIndexInterval, String name, + SegmentMerger(SegmentInfo segmentInfo, InfoStream infoStream, Directory dir, int termIndexInterval, MergeState.CheckAbort checkAbort, PayloadProcessorProvider payloadProcessorProvider, FieldInfos.Builder fieldInfosBuilder, Codec codec, IOContext context) { mergeState.segmentInfo = segmentInfo; @@ -67,7 +66,6 @@ final class SegmentMerger { mergeState.checkAbort = checkAbort; mergeState.payloadProcessorProvider = payloadProcessorProvider; directory = dir; - segment = name; this.termIndexInterval = termIndexInterval; this.codec = codec; this.context = context; @@ -134,7 +132,7 @@ final class SegmentMerger { // write the merged infos FieldInfosWriter fieldInfosWriter = codec.fieldInfosFormat().getFieldInfosWriter(); - fieldInfosWriter.write(directory, segment, mergeState.fieldInfos, context); + fieldInfosWriter.write(directory, mergeState.segmentInfo.name, mergeState.fieldInfos, context); return mergeState; } diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDoc.java b/lucene/core/src/test/org/apache/lucene/index/TestDoc.java index a470a5c9359..1a4dffc6ff0 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDoc.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDoc.java @@ -200,7 +200,7 @@ public class TestDoc extends LuceneTestCase { final SegmentInfo si = new SegmentInfo(si1.info.dir, Constants.LUCENE_MAIN_VERSION, merged, 10000, -1, merged, false, null, false, codec, null, null); SegmentMerger merger = new SegmentMerger(si, InfoStream.getDefault(), trackingDir, IndexWriterConfig.DEFAULT_TERM_INDEX_INTERVAL, - merged, MergeState.CheckAbort.NONE, null, new FieldInfos.Builder(), codec, context); + MergeState.CheckAbort.NONE, null, new FieldInfos.Builder(), codec, context); merger.add(r1); merger.add(r2); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java index 2a00b422276..aff99f2dda4 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java @@ -80,7 +80,7 @@ public class TestSegmentMerger extends LuceneTestCase { final SegmentInfo si = new SegmentInfo(mergedDir, Constants.LUCENE_MAIN_VERSION, mergedSegment, 10000, -1, mergedSegment, false, null, false, codec, null, null); SegmentMerger merger = new SegmentMerger(si, InfoStream.getDefault(), mergedDir, IndexWriterConfig.DEFAULT_TERM_INDEX_INTERVAL, - mergedSegment, MergeState.CheckAbort.NONE, null, new FieldInfos.Builder(), codec, newIOContext(random())); + MergeState.CheckAbort.NONE, null, new FieldInfos.Builder(), codec, newIOContext(random())); merger.add(reader1); merger.add(reader2); MergeState mergeState = merger.merge();