Class FieldMetadata
java.lang.Object
org.apache.lucene.codecs.uniformsplit.FieldMetadata
Metadata and stats for one field in the index.
There is only one instance of FieldMetadata per FieldInfo.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classReads/writes field metadata. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected intprotected final FixedBitSetprotected final FieldInfoprotected longprotected final booleanprotected longprotected BytesRefprotected longprotected longprotected long -
Constructor Summary
ConstructorsModifierConstructorDescriptionFieldMetadata(long dictionaryStartFP, long firstBlockStartFP, long lastBlockStartFP, BytesRef lastTerm) Constructs immutable virtual field metadata for reading.FieldMetadata(FieldInfo fieldInfo, int maxDoc) Constructs field metadata for writing.protectedFieldMetadata(FieldInfo fieldInfo, int maxDoc, boolean isMutable) Constructs field metadata for reading or writing. -
Method Summary
Modifier and TypeMethodDescriptionlongintProvides theFixedBitSetto keep track of the docs seen when callingPostingsWriterBase.writeTerm(BytesRef, TermsEnum, FixedBitSet, org.apache.lucene.codecs.NormsProducer).longlonglonglonglongvoidsetDictionaryStartFP(long dictionaryStartFP) Sets the file pointer to the start of the dictionary of the field.voidsetFirstBlockStartFP(long firstBlockStartFP) Sets the file pointer to the start of the first block of the field.voidsetLastBlockStartFP(long lastBlockStartFP) Sets the file pointer after the end of the last block of the field.voidsetLastTerm(BytesRef lastTerm) voidupdateStats(BlockTermState state) Updates the field stats with the givenBlockTermStatefor the current block line (for one term).
-
Field Details
-
fieldInfo
-
isMutable
protected final boolean isMutable -
docsSeen
-
sumDocFreq
protected long sumDocFreq -
numTerms
protected long numTerms -
sumTotalTermFreq
protected long sumTotalTermFreq -
docCount
protected int docCount -
dictionaryStartFP
protected long dictionaryStartFP -
firstBlockStartFP
protected long firstBlockStartFP -
lastBlockStartFP
protected long lastBlockStartFP -
lastTerm
-
-
Constructor Details
-
FieldMetadata
Constructs field metadata for writing.- Parameters:
maxDoc- The total number of documents in the segment being written.
-
FieldMetadata
public FieldMetadata(long dictionaryStartFP, long firstBlockStartFP, long lastBlockStartFP, BytesRef lastTerm) Constructs immutable virtual field metadata for reading. -
FieldMetadata
Constructs field metadata for reading or writing.- Parameters:
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.
-
-
Method Details
-
updateStats
Updates the field stats with the givenBlockTermStatefor the current block line (for one term). -
getDocsSeen
Provides theFixedBitSetto keep track of the docs seen when callingPostingsWriterBase.writeTerm(BytesRef, TermsEnum, FixedBitSet, org.apache.lucene.codecs.NormsProducer).The returned
FixedBitSetis created once in thisFieldMetadataconstructor.- Returns:
- The
FixedBitSetfor the docs seen, during segment writing; or null if thisFieldMetadatais created immutable during segment reading.
-
getFieldInfo
-
getSumDocFreq
public long getSumDocFreq() -
getNumTerms
public long getNumTerms() -
getSumTotalTermFreq
public long getSumTotalTermFreq() -
getDocCount
public int getDocCount() -
getFirstBlockStartFP
public long getFirstBlockStartFP()- Returns:
- The file pointer to the start of the first block of the field.
-
setFirstBlockStartFP
public void setFirstBlockStartFP(long firstBlockStartFP) Sets the file pointer to the start of the first block of the field. -
getLastBlockStartFP
public long getLastBlockStartFP()- Returns:
- The start file pointer for the last block of the field.
-
setLastBlockStartFP
public void setLastBlockStartFP(long lastBlockStartFP) Sets the file pointer after the end of the last block of the field. -
getDictionaryStartFP
public long getDictionaryStartFP()- Returns:
- The file pointer to the start of the dictionary of the field.
-
setDictionaryStartFP
public void setDictionaryStartFP(long dictionaryStartFP) Sets the file pointer to the start of the dictionary of the field. -
setLastTerm
-
getLastTerm
-