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:
Michael McCandless 2014-05-15 18:22:09 +00:00
parent b1c481d683
commit c06e69a70d
4 changed files with 11 additions and 2568 deletions

View File

@ -37,6 +37,8 @@ import org.apache.lucene.util.Bits;
* time.
* @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
// terms dict impls use to talk to a postings impl.
// TermsDict + PostingsReader/WriterBase == PostingsConsumer/Producer

View File

@ -99,7 +99,7 @@ public class Stats {
this.field = field;
}
void startBlock(BlockTreeTermsReader.FieldReader.SegmentTermsEnum.Frame frame, boolean isFloor) {
void startBlock(FieldReader.SegmentTermsEnum.Frame frame, boolean isFloor) {
totalBlockCount++;
if (isFloor) {
if (frame.fp == frame.fpOrig) {
@ -119,7 +119,7 @@ public class Stats {
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 subBlockCount = frame.entCount - termCount;
totalTermCount += termCount;

View File

@ -31,6 +31,7 @@ import java.util.Map;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.PostingsFormat;
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.index.CheckIndex.Status.DocValuesStatus;
import org.apache.lucene.index.FieldInfo.IndexOptions;
@ -1117,8 +1118,8 @@ public class CheckIndex {
// docs got deleted and then merged away):
} else {
if (fieldTerms instanceof BlockTreeTermsReader.FieldReader) {
final Stats stats = ((BlockTreeTermsReader.FieldReader) fieldTerms).computeStats();
if (fieldTerms instanceof FieldReader) {
final Stats stats = ((FieldReader) fieldTerms).computeStats();
assert stats != null;
if (status.blockTreeStats == null) {
status.blockTreeStats = new HashMap<>();