public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHashPerThread perThread, TermsHashPerThread nextPerThread, FieldInfo fieldInfo) { InitBlock(); this.perThread = perThread; intPool = perThread.intPool; charPool = perThread.charPool; bytePool = perThread.bytePool; docState = perThread.docState; fieldState = docInverterPerField.fieldState; this.consumer = perThread.consumer.AddField(this, fieldInfo); streamCount = consumer.GetStreamCount(); numPostingInt = 2 * streamCount; this.fieldInfo = fieldInfo; if (nextPerThread != null) nextPerField = (TermsHashPerField) nextPerThread.AddField(docInverterPerField, fieldInfo); else nextPerField = null; }
public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHashPerThread perThread, TermsHashPerThread nextPerThread, FieldInfo fieldInfo) { InitBlock(); this.perThread = perThread; intPool = perThread.intPool; charPool = perThread.charPool; bytePool = perThread.bytePool; docState = perThread.docState; fieldState = docInverterPerField.fieldState; this.consumer = perThread.consumer.AddField(this, fieldInfo); streamCount = consumer.GetStreamCount(); numPostingInt = 2 * streamCount; this.fieldInfo = fieldInfo; if (nextPerThread != null) { nextPerField = (TermsHashPerField)nextPerThread.AddField(docInverterPerField, fieldInfo); } else { nextPerField = null; } }
internal TermsHashPerThread AddThread(DocInverterPerThread docInverterPerThread, TermsHashPerThread primaryPerThread) { return(new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, primaryPerThread)); }
internal override void Flush(IDictionary <InvertedDocConsumerPerThread, ICollection <InvertedDocConsumerPerField> > threadsAndFields, SegmentWriteState state) { lock (this) { var childThreadsAndFields = new Dictionary <TermsHashConsumerPerThread, ICollection <TermsHashConsumerPerField> >(); Dictionary <InvertedDocConsumerPerThread, ICollection <InvertedDocConsumerPerField> > nextThreadsAndFields; if (nextTermsHash != null) { nextThreadsAndFields = new Dictionary <InvertedDocConsumerPerThread, ICollection <InvertedDocConsumerPerField> >(); } else { nextThreadsAndFields = null; } foreach (var entry in threadsAndFields) { TermsHashPerThread perThread = (TermsHashPerThread)entry.Key; ICollection <InvertedDocConsumerPerField> fields = entry.Value; var fieldsIt = fields.GetEnumerator(); ICollection <TermsHashConsumerPerField> childFields = new HashSet <TermsHashConsumerPerField>(); ICollection <InvertedDocConsumerPerField> nextChildFields; if (nextTermsHash != null) { nextChildFields = new HashSet <InvertedDocConsumerPerField>(); } else { nextChildFields = null; } while (fieldsIt.MoveNext()) { TermsHashPerField perField = (TermsHashPerField)fieldsIt.Current; childFields.Add(perField.consumer); if (nextTermsHash != null) { nextChildFields.Add(perField.nextPerField); } } childThreadsAndFields[perThread.consumer] = childFields; if (nextTermsHash != null) { nextThreadsAndFields[perThread.nextPerThread] = nextChildFields; } } consumer.Flush(childThreadsAndFields, state); ShrinkFreePostings(threadsAndFields, state); if (nextTermsHash != null) { nextTermsHash.Flush(nextThreadsAndFields, state); } } }
public override TermsHashConsumerPerThread AddThread(TermsHashPerThread perThread) { return(new FreqProxTermsWriterPerThread(perThread)); }
public override TermsHashConsumerPerThread AddThread(TermsHashPerThread termsHashPerThread) { return new TermVectorsTermsWriterPerThread(termsHashPerThread, this); }
internal TermsHashPerThread AddThread(DocInverterPerThread docInverterPerThread, TermsHashPerThread primaryPerThread) { return new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, primaryPerThread); }
public TermVectorsTermsWriterPerThread(TermsHashPerThread termsHashPerThread, TermVectorsTermsWriter termsWriter) { this.termsWriter = termsWriter; this.termsHashPerThread = termsHashPerThread; docState = termsHashPerThread.docState; }
public override TermsHashConsumerPerThread AddThread(TermsHashPerThread termsHashPerThread) { return(new TermVectorsTermsWriterPerThread(termsHashPerThread, this)); }
public abstract TermsHashConsumerPerThread AddThread(TermsHashPerThread perThread);
public override TermsHashConsumerPerThread AddThread(TermsHashPerThread perThread) { return new FreqProxTermsWriterPerThread(perThread); }