final class DefaultIndexingChain extends DocConsumer
Modifier and Type | Class and Description |
---|---|
private class |
DefaultIndexingChain.PerField
NOTE: not static: accesses at least docState, termsHash.
|
Modifier and Type | Field and Description |
---|---|
(package private) Counter |
bytesUsed |
(package private) DocumentsWriterPerThread.DocState |
docState |
(package private) DocumentsWriterPerThread |
docWriter |
private DefaultIndexingChain.PerField[] |
fieldHash |
(package private) FieldInfos.Builder |
fieldInfos |
private DefaultIndexingChain.PerField[] |
fields |
private java.util.Set<java.lang.String> |
finishedDocValues |
private int |
hashMask |
private long |
nextFieldGen |
(package private) StoredFieldsConsumer |
storedFieldsConsumer |
(package private) TermsHash |
termsHash |
private int |
totalFieldCount |
Constructor and Description |
---|
DefaultIndexingChain(DocumentsWriterPerThread docWriter) |
Modifier and Type | Method and Description |
---|---|
void |
abort() |
private void |
finishStoredFields()
Calls StoredFieldsWriter.finishDocument, aborting the
segment if it hits any exception.
|
Sorter.DocMap |
flush(SegmentWriteState state) |
(package private) DocIdSetIterator |
getHasDocValues(java.lang.String field)
Returns a
DocIdSetIterator for the given field or null if the field doesn't have
doc values. |
private DefaultIndexingChain.PerField |
getOrAddField(java.lang.String name,
IndexableFieldType fieldType,
boolean invert)
Returns a previously created
DefaultIndexingChain.PerField ,
absorbing the type information from FieldType ,
and creates a new DefaultIndexingChain.PerField if this field name
wasn't seen yet. |
private DefaultIndexingChain.PerField |
getPerField(java.lang.String name)
Returns a previously created
DefaultIndexingChain.PerField , or null
if this field name wasn't seen yet. |
private void |
indexDocValue(DefaultIndexingChain.PerField fp,
DocValuesType dvType,
IndexableField field)
Called from processDocument to index one field's doc value
|
private void |
indexPoint(DefaultIndexingChain.PerField fp,
IndexableField field)
Called from processDocument to index one field's point
|
private void |
initIndexOptions(FieldInfo info,
IndexOptions indexOptions) |
private Sorter.DocMap |
maybeSortSegment(SegmentWriteState state) |
void |
processDocument() |
private int |
processField(IndexableField field,
long fieldGen,
int fieldCount) |
private void |
rehash() |
private void |
startStoredFields(int docID)
Calls StoredFieldsWriter.startDocument, aborting the
segment if it hits any exception.
|
private void |
validateIndexSortDVType(Sort indexSort,
java.lang.String fieldName,
DocValuesType dvType) |
private static void |
verifyUnIndexedFieldType(java.lang.String name,
IndexableFieldType ft) |
private void |
writeDocValues(SegmentWriteState state,
Sorter.DocMap sortMap)
Writes all buffered doc values (called from
flush(org.apache.lucene.index.SegmentWriteState) ). |
private void |
writeNorms(SegmentWriteState state,
Sorter.DocMap sortMap) |
private void |
writePoints(SegmentWriteState state,
Sorter.DocMap sortMap)
Writes all buffered points.
|
final Counter bytesUsed
final DocumentsWriterPerThread.DocState docState
final DocumentsWriterPerThread docWriter
final FieldInfos.Builder fieldInfos
final TermsHash termsHash
final StoredFieldsConsumer storedFieldsConsumer
private DefaultIndexingChain.PerField[] fieldHash
private int hashMask
private int totalFieldCount
private long nextFieldGen
private DefaultIndexingChain.PerField[] fields
private final java.util.Set<java.lang.String> finishedDocValues
public DefaultIndexingChain(DocumentsWriterPerThread docWriter) throws java.io.IOException
java.io.IOException
private Sorter.DocMap maybeSortSegment(SegmentWriteState state) throws java.io.IOException
java.io.IOException
public Sorter.DocMap flush(SegmentWriteState state) throws java.io.IOException
flush
in class DocConsumer
java.io.IOException
private void writePoints(SegmentWriteState state, Sorter.DocMap sortMap) throws java.io.IOException
java.io.IOException
private void writeDocValues(SegmentWriteState state, Sorter.DocMap sortMap) throws java.io.IOException
flush(org.apache.lucene.index.SegmentWriteState)
).java.io.IOException
private void writeNorms(SegmentWriteState state, Sorter.DocMap sortMap) throws java.io.IOException
java.io.IOException
public void abort() throws java.io.IOException
abort
in class DocConsumer
java.io.IOException
private void rehash()
private void startStoredFields(int docID) throws java.io.IOException
java.io.IOException
private void finishStoredFields() throws java.io.IOException
java.io.IOException
public void processDocument() throws java.io.IOException
processDocument
in class DocConsumer
java.io.IOException
private int processField(IndexableField field, long fieldGen, int fieldCount) throws java.io.IOException
java.io.IOException
private static void verifyUnIndexedFieldType(java.lang.String name, IndexableFieldType ft)
private void indexPoint(DefaultIndexingChain.PerField fp, IndexableField field) throws java.io.IOException
java.io.IOException
private void validateIndexSortDVType(Sort indexSort, java.lang.String fieldName, DocValuesType dvType)
private void indexDocValue(DefaultIndexingChain.PerField fp, DocValuesType dvType, IndexableField field) throws java.io.IOException
java.io.IOException
private DefaultIndexingChain.PerField getPerField(java.lang.String name)
DefaultIndexingChain.PerField
, or null
if this field name wasn't seen yet.private DefaultIndexingChain.PerField getOrAddField(java.lang.String name, IndexableFieldType fieldType, boolean invert)
DefaultIndexingChain.PerField
,
absorbing the type information from FieldType
,
and creates a new DefaultIndexingChain.PerField
if this field name
wasn't seen yet.private void initIndexOptions(FieldInfo info, IndexOptions indexOptions)
DocIdSetIterator getHasDocValues(java.lang.String field)
DocConsumer
DocIdSetIterator
for the given field or null if the field doesn't have
doc values.getHasDocValues
in class DocConsumer