public class FieldMetadata extends Object implements Accountable
There is only one instance of FieldMetadata
per FieldInfo
.
Modifier and Type | Class and Description |
---|---|
static class |
FieldMetadata.Serializer
Reads/writes field metadata.
|
Modifier and Type | Field and Description |
---|---|
protected long |
dictionaryStartFP |
protected int |
docCount |
protected FixedBitSet |
docsSeen |
protected FieldInfo |
fieldInfo |
protected long |
firstBlockStartFP |
protected boolean |
isMutable |
protected long |
lastBlockStartFP |
protected BytesRef |
lastTerm |
protected long |
numTerms |
protected long |
sumDocFreq |
protected long |
sumTotalTermFreq |
NULL_ACCOUNTABLE
Modifier | Constructor and Description |
---|---|
|
FieldMetadata(FieldInfo fieldInfo,
int maxDoc)
Constructs field metadata for writing.
|
protected |
FieldMetadata(FieldInfo fieldInfo,
int maxDoc,
boolean isMutable)
Constructs field metadata for reading or writing.
|
|
FieldMetadata(long dictionaryStartFP,
long firstBlockStartFP,
long lastBlockStartFP,
BytesRef lastTerm)
Constructs immutable virtual field metadata for reading.
|
Modifier and Type | Method and Description |
---|---|
long |
getDictionaryStartFP() |
int |
getDocCount() |
FixedBitSet |
getDocsSeen()
Provides the
FixedBitSet to keep track of the docs seen when calling
PostingsWriterBase.writeTerm(BytesRef, TermsEnum, FixedBitSet, org.apache.lucene.codecs.NormsProducer) . |
FieldInfo |
getFieldInfo() |
long |
getFirstBlockStartFP() |
long |
getLastBlockStartFP() |
BytesRef |
getLastTerm() |
long |
getNumTerms() |
long |
getSumDocFreq() |
long |
getSumTotalTermFreq() |
long |
ramBytesUsed() |
void |
setDictionaryStartFP(long dictionaryStartFP)
Sets the file pointer to the start of the dictionary of the field.
|
void |
setFirstBlockStartFP(long firstBlockStartFP)
Sets the file pointer to the start of the first block of the field.
|
void |
setLastBlockStartFP(long lastBlockStartFP)
Sets the file pointer after the end of the last block of the field.
|
void |
setLastTerm(BytesRef lastTerm) |
void |
updateStats(BlockTermState state)
Updates the field stats with the given
BlockTermState for the current
block line (for one term). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildResources
protected final FieldInfo fieldInfo
protected final boolean isMutable
protected final FixedBitSet docsSeen
protected long sumDocFreq
protected long numTerms
protected long sumTotalTermFreq
protected int docCount
protected long dictionaryStartFP
protected long firstBlockStartFP
protected long lastBlockStartFP
protected BytesRef lastTerm
public FieldMetadata(FieldInfo fieldInfo, int maxDoc)
maxDoc
- The total number of documents in the segment being written.public FieldMetadata(long dictionaryStartFP, long firstBlockStartFP, long lastBlockStartFP, BytesRef lastTerm)
protected FieldMetadata(FieldInfo fieldInfo, int maxDoc, boolean isMutable)
maxDoc
- The total number of documents in the segment being written.isMutable
- Set true if this FieldMetadata is created for writing the index. Set false if it is used for reading the index.public void updateStats(BlockTermState state)
BlockTermState
for the current
block line (for one term).public FixedBitSet getDocsSeen()
FixedBitSet
to keep track of the docs seen when calling
PostingsWriterBase.writeTerm(BytesRef, TermsEnum, FixedBitSet, org.apache.lucene.codecs.NormsProducer)
.
The returned FixedBitSet
is created once in this FieldMetadata
constructor.
FixedBitSet
for the docs seen, during segment writing;
or null if this FieldMetadata
is created immutable during segment reading.public FieldInfo getFieldInfo()
public long getSumDocFreq()
public long getNumTerms()
public long getSumTotalTermFreq()
public int getDocCount()
public long getFirstBlockStartFP()
public void setFirstBlockStartFP(long firstBlockStartFP)
public long getLastBlockStartFP()
public void setLastBlockStartFP(long lastBlockStartFP)
public long getDictionaryStartFP()
public void setDictionaryStartFP(long dictionaryStartFP)
public void setLastTerm(BytesRef lastTerm)
public BytesRef getLastTerm()
public long ramBytesUsed()
ramBytesUsed
in interface Accountable
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.