mirror of https://github.com/apache/lucene.git
LUCENE-4055: don't populate upgraded SI with bogus stuff
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4055@1342254 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d4f49a8959
commit
ba7f596a67
|
@ -251,22 +251,10 @@ public class Lucene3xSegmentInfoReader extends SegmentInfoReader {
|
|||
|
||||
final String version = input.readString();
|
||||
|
||||
// nocommit: we ignore this and use the incoming arg: don't write this
|
||||
input.readString();
|
||||
|
||||
final int docCount = input.readInt();
|
||||
// nocommit: dont write this
|
||||
final long delGen = input.readLong();
|
||||
|
||||
final Map<String,String> attributes = input.readStringStringMap();
|
||||
|
||||
// pre-4.0 indexes write a byte if there is a single norms file
|
||||
byte b = input.readByte();
|
||||
|
||||
//System.out.println("version=" + version + " name=" + name + " docCount=" + docCount + " delGen=" + delGen + " dso=" + docStoreOffset + " dss=" + docStoreSegment + " dssCFs=" + docStoreIsCompoundFile + " b=" + b + " format=" + format);
|
||||
|
||||
// nocommit: don't write this
|
||||
assert 1 == b : "expected 1 but was: "+ b;
|
||||
final int numNormGen = input.readInt();
|
||||
final Map<Integer,Long> normGen;
|
||||
if (numNormGen == SegmentInfo.NO) {
|
||||
|
@ -279,17 +267,8 @@ public class Lucene3xSegmentInfoReader extends SegmentInfoReader {
|
|||
}
|
||||
final boolean isCompoundFile = input.readByte() == SegmentInfo.YES;
|
||||
|
||||
final int delCount = input.readInt();
|
||||
assert delCount <= docCount;
|
||||
|
||||
// nocommit: unused, dont write this
|
||||
final boolean hasProx = input.readByte() == 1;
|
||||
|
||||
final Map<String,String> diagnostics = input.readStringStringMap();
|
||||
|
||||
// nocommit: unused, dont write this
|
||||
final int hasVectors = input.readByte();
|
||||
|
||||
final Set<String> files = input.readStringSet();
|
||||
|
||||
// nocommit: convert normgen into attributes?
|
||||
|
|
|
@ -423,15 +423,9 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerCom
|
|||
assert si.getCodec() instanceof Lucene3xCodec : "broken test, trying to mix preflex with other codecs";
|
||||
// Write the Lucene version that created this segment, since 3.1
|
||||
output.writeString(si.getVersion());
|
||||
output.writeString(si.name);
|
||||
output.writeInt(si.getDocCount());
|
||||
|
||||
// NOTE: a lie
|
||||
output.writeLong(0L);
|
||||
|
||||
output.writeStringStringMap(si.attributes());
|
||||
// pre-4.0 indexes write a byte if there is a single norms file
|
||||
output.writeByte((byte) 1);
|
||||
|
||||
Map<Integer,Long> normGen = si.getNormGen();
|
||||
if (normGen == null) {
|
||||
|
@ -444,15 +438,7 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfoPerCom
|
|||
}
|
||||
|
||||
output.writeByte((byte) (si.getUseCompoundFile() ? SegmentInfo.YES : SegmentInfo.NO));
|
||||
|
||||
// NOTE: a lie
|
||||
output.writeInt(0);
|
||||
|
||||
// hasProx (lie):
|
||||
output.writeByte((byte) 1);
|
||||
output.writeStringStringMap(si.getDiagnostics());
|
||||
// hasVectors (lie):
|
||||
output.writeByte((byte) 1);
|
||||
output.writeStringSet(si.files());
|
||||
|
||||
success = true;
|
||||
|
|
Loading…
Reference in New Issue