public class DeltaBaseTermStateSerializer extends Object implements Accountable
TermState
serializer which encodes each file pointer as a delta relative
to a base file pointer. It differs from Lucene84PostingsWriter.encodeTerm(org.apache.lucene.store.DataOutput, org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.BlockTermState, boolean)
which encodes each file pointer as a delta relative to the previous file pointer.
It automatically sets the base file pointer to the first valid file pointer for
doc start FP, pos start FP, pay start FP. These base file pointers have to be
reset
by the caller before starting to write a new block.
Modifier and Type | Field and Description |
---|---|
protected long |
baseDocStartFP |
protected long |
basePayStartFP |
protected long |
basePosStartFP |
NULL_ACCOUNTABLE
Constructor and Description |
---|
DeltaBaseTermStateSerializer() |
Modifier and Type | Method and Description |
---|---|
long |
getBaseDocStartFP() |
long |
getBasePayStartFP() |
long |
getBasePosStartFP() |
long |
ramBytesUsed() |
static long |
ramBytesUsed(TermState termState) |
BlockTermState |
readTermState(long baseDocStartFP,
long basePosStartFP,
long basePayStartFP,
DataInput termStatesInput,
FieldInfo fieldInfo,
BlockTermState reuse)
Reads a
BlockTermState from the provided DataInput . |
protected Lucene84PostingsFormat.IntBlockTermState |
reset(Lucene84PostingsFormat.IntBlockTermState termState) |
void |
resetBaseStartFP()
Resets the base file pointers to 0.
|
void |
writeTermState(DataOutput termStatesOutput,
FieldInfo fieldInfo,
BlockTermState termState)
Writes a
BlockTermState to the provided DataOutput . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildResources
protected long baseDocStartFP
protected long basePosStartFP
protected long basePayStartFP
public void resetBaseStartFP()
public long getBaseDocStartFP()
TermState
written after resetBaseStartFP()
is called.public long getBasePosStartFP()
TermState
written after resetBaseStartFP()
is called.public long getBasePayStartFP()
TermState
written after resetBaseStartFP()
is called.public void writeTermState(DataOutput termStatesOutput, FieldInfo fieldInfo, BlockTermState termState) throws IOException
BlockTermState
to the provided DataOutput
.
Simpler variant of Lucene84PostingsWriter.encodeTerm(DataOutput, FieldInfo, BlockTermState, boolean)
.
IOException
public BlockTermState readTermState(long baseDocStartFP, long basePosStartFP, long basePayStartFP, DataInput termStatesInput, FieldInfo fieldInfo, BlockTermState reuse) throws IOException
BlockTermState
from the provided DataInput
.
Simpler variant of Lucene84PostingsReader.decodeTerm(DataInput, FieldInfo, BlockTermState, boolean)
.
reuse
- BlockTermState
to reuse; or null to create a new one.IOException
protected Lucene84PostingsFormat.IntBlockTermState reset(Lucene84PostingsFormat.IntBlockTermState termState)
public long ramBytesUsed()
ramBytesUsed
in interface Accountable
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.