public abstract class PostingsWriterBase extends Object implements Closeable
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 IOException
termsOut
.IOException
public abstract BlockTermState writeTerm(BytesRef term, TermsEnum termsEnum, FixedBitSet docsSeen, NormsProducer norms) throws IOException
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.IOException
public abstract void encodeTerm(DataOutput out, FieldInfo fieldInfo, BlockTermState state, boolean absolute) throws IOException
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.IOException
public abstract void setField(FieldInfo fieldInfo)
public abstract void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.