LUCENE-4055: rename method

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4055@1341639 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-05-22 21:23:56 +00:00
parent ffb88a89ef
commit c2047945cb
9 changed files with 14 additions and 15 deletions

View File

@ -70,9 +70,8 @@ public abstract class Codec implements NamedSPILoader.NamedSPI {
/** Encodes/decodes field infos file */ /** Encodes/decodes field infos file */
public abstract FieldInfosFormat fieldInfosFormat(); public abstract FieldInfosFormat fieldInfosFormat();
/** Encodes/decodes segments file */ /** Encodes/decodes segment info file */
// nocommit rename public abstract SegmentInfoFormat segmentInfoFormat();
public abstract SegmentInfoFormat segmentInfosFormat();
/** Encodes/decodes document normalization values */ /** Encodes/decodes document normalization values */
public abstract NormsFormat normsFormat(); public abstract NormsFormat normsFormat();

View File

@ -76,7 +76,7 @@ public class AppendingCodec extends Codec {
} }
@Override @Override
public SegmentInfoFormat segmentInfosFormat() { public SegmentInfoFormat segmentInfoFormat() {
return infos; return infos;
} }

View File

@ -113,7 +113,7 @@ public class Lucene3xCodec extends Codec {
} }
@Override @Override
public SegmentInfoFormat segmentInfosFormat() { public SegmentInfoFormat segmentInfoFormat() {
return infosFormat; return infosFormat;
} }

View File

@ -83,7 +83,7 @@ public class Lucene40Codec extends Codec {
} }
@Override @Override
public SegmentInfoFormat segmentInfosFormat() { public SegmentInfoFormat segmentInfoFormat() {
return infosFormat; return infosFormat;
} }

View File

@ -75,7 +75,7 @@ public final class SimpleTextCodec extends Codec {
} }
@Override @Override
public SegmentInfoFormat segmentInfosFormat() { public SegmentInfoFormat segmentInfoFormat() {
return segmentInfos; return segmentInfos;
} }

View File

@ -2044,7 +2044,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
// creating CFS so that 1) .si isn't slurped into CFS, // creating CFS so that 1) .si isn't slurped into CFS,
// and 2) .si reflects useCompoundFile=true change // and 2) .si reflects useCompoundFile=true change
// above: // above:
codec.segmentInfosFormat().getSegmentInfosWriter().write(directory, newSegment.info, flushedSegment.fieldInfos, context); codec.segmentInfoFormat().getSegmentInfosWriter().write(directory, newSegment.info, flushedSegment.fieldInfos, context);
// nocommit ideally we would freeze newSegment here!! // nocommit ideally we would freeze newSegment here!!
// because any changes after writing the .si will be // because any changes after writing the .si will be
@ -2334,7 +2334,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
// creating CFS so that 1) .si isn't slurped into CFS, // creating CFS so that 1) .si isn't slurped into CFS,
// and 2) .si reflects useCompoundFile=true change // and 2) .si reflects useCompoundFile=true change
// above: // above:
codec.segmentInfosFormat().getSegmentInfosWriter().write(trackingDir, info, mergeState.fieldInfos, context); codec.segmentInfoFormat().getSegmentInfosWriter().write(trackingDir, info, mergeState.fieldInfos, context);
info.getFiles().addAll(trackingDir.getCreatedFiles()); info.getFiles().addAll(trackingDir.getCreatedFiles());
// Register the new segment // Register the new segment
@ -2420,7 +2420,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
// segment name (its own name, if its 3.x, and doc // segment name (its own name, if its 3.x, and doc
// store segment name): // store segment name):
try { try {
newInfo.getCodec().segmentInfosFormat().getSegmentInfosWriter().write(directory, newInfo, null, context); newInfo.getCodec().segmentInfoFormat().getSegmentInfosWriter().write(directory, newInfo, null, context);
} catch (UnsupportedOperationException uoe) { } catch (UnsupportedOperationException uoe) {
// OK: 3x codec cannot write a new SI file; // OK: 3x codec cannot write a new SI file;
// SegmentInfos will write this on commit // SegmentInfos will write this on commit
@ -3579,7 +3579,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
// above: // above:
boolean success2 = false; boolean success2 = false;
try { try {
codec.segmentInfosFormat().getSegmentInfosWriter().write(directory, merge.info.info, mergeState.fieldInfos, context); codec.segmentInfoFormat().getSegmentInfosWriter().write(directory, merge.info.info, mergeState.fieldInfos, context);
success2 = true; success2 = true;
} finally { } finally {
if (!success2) { if (!success2) {

View File

@ -284,7 +284,7 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerCom
String segName = input.readString(); String segName = input.readString();
Codec codec = Codec.forName(input.readString()); Codec codec = Codec.forName(input.readString());
//System.out.println("SIS.read seg=" + seg + " codec=" + codec); //System.out.println("SIS.read seg=" + seg + " codec=" + codec);
SegmentInfo info = codec.segmentInfosFormat().getSegmentInfosReader().read(directory, segName, IOContext.READ); SegmentInfo info = codec.segmentInfoFormat().getSegmentInfosReader().read(directory, segName, IOContext.READ);
info.setCodec(codec); info.setCodec(codec);
long delGen = input.readLong(); long delGen = input.readLong();
int delCount = input.readInt(); int delCount = input.readInt();

View File

@ -1150,7 +1150,7 @@ public class TestAddIndexes extends LuceneTestCase {
} }
@Override @Override
public SegmentInfoFormat segmentInfosFormat() { public SegmentInfoFormat segmentInfoFormat() {
return new Lucene40SegmentInfoFormat(); return new Lucene40SegmentInfoFormat();
} }

View File

@ -66,11 +66,11 @@ public class PreFlexRWCodec extends Lucene3xCodec {
} }
@Override @Override
public SegmentInfoFormat segmentInfosFormat() { public SegmentInfoFormat segmentInfoFormat() {
if (LuceneTestCase.PREFLEX_IMPERSONATION_IS_ACTIVE) { if (LuceneTestCase.PREFLEX_IMPERSONATION_IS_ACTIVE) {
return segmentInfos ; return segmentInfos ;
} else { } else {
return super.segmentInfosFormat(); return super.segmentInfoFormat();
} }
} }