mirror of https://github.com/apache/lucene.git
LUCENE-5675: pull out FieldReader from BTTR
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5675@1595006 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b1c481d683
commit
c06e69a70d
|
@ -37,6 +37,8 @@ import org.apache.lucene.util.Bits;
|
||||||
* time.
|
* time.
|
||||||
* @lucene.experimental */
|
* @lucene.experimental */
|
||||||
|
|
||||||
|
// nocommit mv under blocktree? but ... it's used by others (e.g. block terms)
|
||||||
|
|
||||||
// TODO: find a better name; this defines the API that the
|
// TODO: find a better name; this defines the API that the
|
||||||
// terms dict impls use to talk to a postings impl.
|
// terms dict impls use to talk to a postings impl.
|
||||||
// TermsDict + PostingsReader/WriterBase == PostingsConsumer/Producer
|
// TermsDict + PostingsReader/WriterBase == PostingsConsumer/Producer
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -99,7 +99,7 @@ public class Stats {
|
||||||
this.field = field;
|
this.field = field;
|
||||||
}
|
}
|
||||||
|
|
||||||
void startBlock(BlockTreeTermsReader.FieldReader.SegmentTermsEnum.Frame frame, boolean isFloor) {
|
void startBlock(FieldReader.SegmentTermsEnum.Frame frame, boolean isFloor) {
|
||||||
totalBlockCount++;
|
totalBlockCount++;
|
||||||
if (isFloor) {
|
if (isFloor) {
|
||||||
if (frame.fp == frame.fpOrig) {
|
if (frame.fp == frame.fpOrig) {
|
||||||
|
@ -119,7 +119,7 @@ public class Stats {
|
||||||
totalBlockStatsBytes += frame.statsReader.length();
|
totalBlockStatsBytes += frame.statsReader.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
void endBlock(BlockTreeTermsReader.FieldReader.SegmentTermsEnum.Frame frame) {
|
void endBlock(FieldReader.SegmentTermsEnum.Frame frame) {
|
||||||
final int termCount = frame.isLeafBlock ? frame.entCount : frame.state.termBlockOrd;
|
final int termCount = frame.isLeafBlock ? frame.entCount : frame.state.termBlockOrd;
|
||||||
final int subBlockCount = frame.entCount - termCount;
|
final int subBlockCount = frame.entCount - termCount;
|
||||||
totalTermCount += termCount;
|
totalTermCount += termCount;
|
||||||
|
|
|
@ -31,6 +31,7 @@ import java.util.Map;
|
||||||
import org.apache.lucene.codecs.Codec;
|
import org.apache.lucene.codecs.Codec;
|
||||||
import org.apache.lucene.codecs.PostingsFormat;
|
import org.apache.lucene.codecs.PostingsFormat;
|
||||||
import org.apache.lucene.codecs.blocktree.BlockTreeTermsReader;
|
import org.apache.lucene.codecs.blocktree.BlockTreeTermsReader;
|
||||||
|
import org.apache.lucene.codecs.blocktree.FieldReader;
|
||||||
import org.apache.lucene.codecs.blocktree.Stats;
|
import org.apache.lucene.codecs.blocktree.Stats;
|
||||||
import org.apache.lucene.index.CheckIndex.Status.DocValuesStatus;
|
import org.apache.lucene.index.CheckIndex.Status.DocValuesStatus;
|
||||||
import org.apache.lucene.index.FieldInfo.IndexOptions;
|
import org.apache.lucene.index.FieldInfo.IndexOptions;
|
||||||
|
@ -1117,8 +1118,8 @@ public class CheckIndex {
|
||||||
// docs got deleted and then merged away):
|
// docs got deleted and then merged away):
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (fieldTerms instanceof BlockTreeTermsReader.FieldReader) {
|
if (fieldTerms instanceof FieldReader) {
|
||||||
final Stats stats = ((BlockTreeTermsReader.FieldReader) fieldTerms).computeStats();
|
final Stats stats = ((FieldReader) fieldTerms).computeStats();
|
||||||
assert stats != null;
|
assert stats != null;
|
||||||
if (status.blockTreeStats == null) {
|
if (status.blockTreeStats == null) {
|
||||||
status.blockTreeStats = new HashMap<>();
|
status.blockTreeStats = new HashMap<>();
|
||||||
|
|
Loading…
Reference in New Issue