public abstract class PostingsWriterBase
extends
implements
BlockTreeTermsWriter
, and handles writing postings.PostingsReaderBase
Modifier | Constructor and Description |
---|---|
protected |
PostingsWriterBase()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
close() |
abstract void |
encodeTerm(DataOutput out,
FieldInfo fieldInfo,
BlockTermState state,
boolean absolute)
Encode metadata as long[] and byte[].
|
abstract void |
init(IndexOutput termsOut,
SegmentWriteState state)
Called once after startup, before any terms have been
added.
|
abstract void |
setField(FieldInfo fieldInfo)
Sets the current field for writing.
|
abstract BlockTermState |
writeTerm(BytesRef term,
TermsEnum termsEnum,
FixedBitSet docsSeen,
NormsProducer norms)
Write all postings for one term; use the provided
TermsEnum to pull a PostingsEnum . |
protected PostingsWriterBase()
public abstract void init(IndexOutput termsOut, SegmentWriteState state) throws
termsOut
.
public abstract BlockTermState writeTerm(BytesRef term, TermsEnum termsEnum, FixedBitSet docsSeen, NormsProducer norms) throws
TermsEnum
to pull a PostingsEnum
.
This method should not
re-position the TermsEnum
! It is already
positioned on the term that should be written. This
method must set the bit in the provided FixedBitSet
for every docID written. If no docs
were written, this method should return null, and the
terms dict will skip the term.
public abstract void encodeTerm(DataOutput out, FieldInfo fieldInfo, BlockTermState state, boolean absolute) throws
absolute
controls whether
current term is delta encoded according to latest term.
Usually elements in longs
are file pointers, so each one always
increases when a new term is consumed. out
is used to write generic
bytes, which are not monotonic.
public abstract void setField(FieldInfo fieldInfo)
public abstract void close() throws
in interface
in interface
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.