remove nocommit in SegmentReader and simplify code which gets the DocStoreSegment

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1062388 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2011-01-23 11:11:42 +00:00
parent 133e70cad6
commit a2218c398f
2 changed files with 3 additions and 8 deletions

View File

@ -103,6 +103,7 @@ public final class SegmentInfo {
delGen = NO; delGen = NO;
this.isCompoundFile = isCompoundFile; this.isCompoundFile = isCompoundFile;
this.docStoreOffset = -1; this.docStoreOffset = -1;
this.docStoreSegment = name;
this.hasProx = hasProx; this.hasProx = hasProx;
this.segmentCodecs = segmentCodecs; this.segmentCodecs = segmentCodecs;
this.hasVectors = hasVectors; this.hasVectors = hasVectors;
@ -121,6 +122,7 @@ public final class SegmentInfo {
dir = src.dir; dir = src.dir;
delGen = src.delGen; delGen = src.delGen;
docStoreOffset = src.docStoreOffset; docStoreOffset = src.docStoreOffset;
docStoreSegment = src.docStoreSegment;
docStoreIsCompoundFile = src.docStoreIsCompoundFile; docStoreIsCompoundFile = src.docStoreIsCompoundFile;
hasVectors = src.hasVectors; hasVectors = src.hasVectors;
hasProx = src.hasProx; hasProx = src.hasProx;

View File

@ -226,14 +226,7 @@ public class SegmentReader extends IndexReader implements Cloneable {
assert storeDir != null; assert storeDir != null;
} }
// nocommit: this can be simplified to always be si.getDocStoreSegment() final String storesSegment = si.getDocStoreSegment();
final String storesSegment;
if (si.getDocStoreOffset() != -1) {
storesSegment = si.getDocStoreSegment();
} else {
storesSegment = segment;
}
fieldsReaderOrig = new FieldsReader(storeDir, storesSegment, fieldInfos, readBufferSize, fieldsReaderOrig = new FieldsReader(storeDir, storesSegment, fieldInfos, readBufferSize,
si.getDocStoreOffset(), si.docCount); si.getDocStoreOffset(), si.docCount);