LUCENE-8906: Lucene50PostingsFormat.IntBlockTermState becomes public

This commit is contained in:
Bruno Roustant 2019-08-02 00:18:12 +02:00 committed by David Smiley
parent ab470a6564
commit 52b5ec8068
2 changed files with 33 additions and 10 deletions

View File

@ -78,6 +78,9 @@ Improvements
* LUCENE-8916: GraphTokenStreamFiniteStrings preserves all Token attributes * LUCENE-8916: GraphTokenStreamFiniteStrings preserves all Token attributes
through its finite strings TokenStreams (Alan Woodward) through its finite strings TokenStreams (Alan Woodward)
* LUCENE-8906: Expose Lucene50PostingsFormat.IntBlockTermState as public so that other postings formats can re-use it.
(Bruno Roustant)
Optimizations Optimizations
* LUCENE-8922: DisjunctionMaxQuery more efficiently leverages impacts to skip * LUCENE-8922: DisjunctionMaxQuery more efficiently leverages impacts to skip

View File

@ -452,16 +452,36 @@ public final class Lucene50PostingsFormat extends PostingsFormat {
} }
} }
} }
final static class IntBlockTermState extends BlockTermState { /**
long docStartFP = 0; * Holds all state required for {@link Lucene50PostingsReader} to produce a
long posStartFP = 0; * {@link org.apache.lucene.index.PostingsEnum} without re-seeking the terms dict.
long payStartFP = 0; *
long skipOffset = -1; * @lucene.internal
long lastPosBlockOffset = -1; */
// docid when there is a single pulsed posting, otherwise -1 public static final class IntBlockTermState extends BlockTermState {
// freq is always implicitly totalTermFreq in this case. /** file pointer to the start of the doc ids enumeration, in {@link #DOC_EXTENSION} file */
int singletonDocID = -1; public long docStartFP;
/** file pointer to the start of the positions enumeration, in {@link #POS_EXTENSION} file */
public long posStartFP;
/** file pointer to the start of the payloads enumeration, in {@link #PAY_EXTENSION} file */
public long payStartFP;
/** file offset for the start of the skip list, relative to docStartFP, if there are more
* than {@link #BLOCK_SIZE} docs; otherwise -1 */
public long skipOffset;
/** file offset for the last position in the last block, if there are more than
* {@link #BLOCK_SIZE} positions; otherwise -1 */
public long lastPosBlockOffset;
/** docid when there is a single pulsed posting, otherwise -1.
* freq is always implicitly totalTermFreq in this case. */
public int singletonDocID;
/** Sole constructor. */
public IntBlockTermState() {
skipOffset = -1;
lastPosBlockOffset = -1;
singletonDocID = -1;
}
@Override @Override
public IntBlockTermState clone() { public IntBlockTermState clone() {