LUCENE-4055: remove redundant parameter

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4055@1341680 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-05-22 23:27:27 +00:00
parent b1693f5cab
commit 4a4c56b99d
4 changed files with 6 additions and 8 deletions

View File

@ -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")) {

View File

@ -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;
}

View File

@ -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);

View File

@ -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();