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;
this.isCompoundFile = isCompoundFile;
this.docStoreOffset = -1;
this.docStoreSegment = name;
this.hasProx = hasProx;
this.segmentCodecs = segmentCodecs;
this.hasVectors = hasVectors;
@ -121,6 +122,7 @@ public final class SegmentInfo {
dir = src.dir;
delGen = src.delGen;
docStoreOffset = src.docStoreOffset;
docStoreSegment = src.docStoreSegment;
docStoreIsCompoundFile = src.docStoreIsCompoundFile;
hasVectors = src.hasVectors;
hasProx = src.hasProx;

View File

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