mirror of https://github.com/apache/lucene.git
Renamed getCodecInfo to getSegmentCodecs for consistency
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1034570 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
69313c1d47
commit
e95fbfd1df
|
@ -408,7 +408,7 @@ public class CheckIndex {
|
||||||
SegmentReader reader = null;
|
SegmentReader reader = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final SegmentCodecs codec = info.getCodecInfo();
|
final SegmentCodecs codec = info.getSegmentCodecs();
|
||||||
msg(" codec=" + codec);
|
msg(" codec=" + codec);
|
||||||
segInfoStat.codec = codec;
|
segInfoStat.codec = codec;
|
||||||
msg(" compound=" + info.getUseCompoundFile());
|
msg(" compound=" + info.getUseCompoundFile());
|
||||||
|
|
|
@ -85,7 +85,7 @@ public final class SegmentInfo {
|
||||||
private Map<String,String> diagnostics;
|
private Map<String,String> diagnostics;
|
||||||
|
|
||||||
public SegmentInfo(String name, int docCount, Directory dir, boolean isCompoundFile, int docStoreOffset,
|
public SegmentInfo(String name, int docCount, Directory dir, boolean isCompoundFile, int docStoreOffset,
|
||||||
String docStoreSegment, boolean docStoreIsCompoundFile, boolean hasProx, SegmentCodecs codecInfo) {
|
String docStoreSegment, boolean docStoreIsCompoundFile, boolean hasProx, SegmentCodecs segmentCodecs) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.docCount = docCount;
|
this.docCount = docCount;
|
||||||
this.dir = dir;
|
this.dir = dir;
|
||||||
|
@ -95,7 +95,7 @@ public final class SegmentInfo {
|
||||||
this.docStoreSegment = docStoreSegment;
|
this.docStoreSegment = docStoreSegment;
|
||||||
this.docStoreIsCompoundFile = docStoreIsCompoundFile;
|
this.docStoreIsCompoundFile = docStoreIsCompoundFile;
|
||||||
this.hasProx = hasProx;
|
this.hasProx = hasProx;
|
||||||
this.segmentCodecs = codecInfo;
|
this.segmentCodecs = segmentCodecs;
|
||||||
delCount = 0;
|
delCount = 0;
|
||||||
assert docStoreOffset == -1 || docStoreSegment != null: "dso=" + docStoreOffset + " dss=" + docStoreSegment + " docCount=" + docCount;
|
assert docStoreOffset == -1 || docStoreSegment != null: "dso=" + docStoreOffset + " dss=" + docStoreSegment + " docCount=" + docCount;
|
||||||
}
|
}
|
||||||
|
@ -420,7 +420,7 @@ public final class SegmentInfo {
|
||||||
this.segmentCodecs = segmentCodecs;
|
this.segmentCodecs = segmentCodecs;
|
||||||
}
|
}
|
||||||
|
|
||||||
SegmentCodecs getCodecInfo() {
|
SegmentCodecs getSegmentCodecs() {
|
||||||
return segmentCodecs;
|
return segmentCodecs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -308,7 +308,7 @@ public final class SegmentInfos extends Vector<SegmentInfo> {
|
||||||
SegmentInfos sis = (SegmentInfos) super.clone();
|
SegmentInfos sis = (SegmentInfos) super.clone();
|
||||||
for(int i=0;i<sis.size();i++) {
|
for(int i=0;i<sis.size();i++) {
|
||||||
final SegmentInfo info = sis.info(i);
|
final SegmentInfo info = sis.info(i);
|
||||||
assert info.getCodecInfo() != null;
|
assert info.getSegmentCodecs() != null;
|
||||||
sis.set(i, (SegmentInfo) info.clone());
|
sis.set(i, (SegmentInfo) info.clone());
|
||||||
}
|
}
|
||||||
sis.userData = new HashMap<String,String>(userData);
|
sis.userData = new HashMap<String,String>(userData);
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class SegmentReader extends IndexReader implements Cloneable {
|
||||||
}
|
}
|
||||||
|
|
||||||
segment = si.name;
|
segment = si.name;
|
||||||
final SegmentCodecs codecInfo = si.getCodecInfo();
|
final SegmentCodecs segmentCodecs = si.getSegmentCodecs();
|
||||||
this.readBufferSize = readBufferSize;
|
this.readBufferSize = readBufferSize;
|
||||||
this.dir = dir;
|
this.dir = dir;
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ public class SegmentReader extends IndexReader implements Cloneable {
|
||||||
this.termsIndexDivisor = termsIndexDivisor;
|
this.termsIndexDivisor = termsIndexDivisor;
|
||||||
|
|
||||||
// Ask codec for its Fields
|
// Ask codec for its Fields
|
||||||
fields = codecInfo.codec().fieldsProducer(new SegmentReadState(cfsDir, si, fieldInfos, readBufferSize, termsIndexDivisor));
|
fields = segmentCodecs.codec().fieldsProducer(new SegmentReadState(cfsDir, si, fieldInfos, readBufferSize, termsIndexDivisor));
|
||||||
assert fields != null;
|
assert fields != null;
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
|
|
|
@ -273,7 +273,7 @@ public class TestCodecs extends LuceneTestCase {
|
||||||
final SegmentInfo si = new SegmentInfo(SEGMENT, 10000, dir, false, -1, SEGMENT, false, true, SegmentCodecs.build(fieldInfos, CodecProvider.getDefault()));
|
final SegmentInfo si = new SegmentInfo(SEGMENT, 10000, dir, false, -1, SEGMENT, false, true, SegmentCodecs.build(fieldInfos, CodecProvider.getDefault()));
|
||||||
si.setHasProx(false);
|
si.setHasProx(false);
|
||||||
|
|
||||||
final FieldsProducer reader = si.getCodecInfo().codec().fieldsProducer(new SegmentReadState(dir, si, fieldInfos, 64, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR));
|
final FieldsProducer reader = si.getSegmentCodecs().codec().fieldsProducer(new SegmentReadState(dir, si, fieldInfos, 64, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR));
|
||||||
|
|
||||||
final FieldsEnum fieldsEnum = reader.iterator();
|
final FieldsEnum fieldsEnum = reader.iterator();
|
||||||
assertNotNull(fieldsEnum.next());
|
assertNotNull(fieldsEnum.next());
|
||||||
|
@ -320,7 +320,7 @@ public class TestCodecs extends LuceneTestCase {
|
||||||
this.write(fieldInfos, dir, fields);
|
this.write(fieldInfos, dir, fields);
|
||||||
final SegmentInfo si = new SegmentInfo(SEGMENT, 10000, dir, false, -1, SEGMENT, false, true, SegmentCodecs.build(fieldInfos, CodecProvider.getDefault()));
|
final SegmentInfo si = new SegmentInfo(SEGMENT, 10000, dir, false, -1, SEGMENT, false, true, SegmentCodecs.build(fieldInfos, CodecProvider.getDefault()));
|
||||||
|
|
||||||
final FieldsProducer terms = si.getCodecInfo().codec().fieldsProducer(new SegmentReadState(dir, si, fieldInfos, 1024, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR));
|
final FieldsProducer terms = si.getSegmentCodecs().codec().fieldsProducer(new SegmentReadState(dir, si, fieldInfos, 1024, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR));
|
||||||
|
|
||||||
final Verify[] threads = new Verify[NUM_TEST_THREADS-1];
|
final Verify[] threads = new Verify[NUM_TEST_THREADS-1];
|
||||||
for(int i=0;i<NUM_TEST_THREADS-1;i++) {
|
for(int i=0;i<NUM_TEST_THREADS-1;i++) {
|
||||||
|
|
Loading…
Reference in New Issue