public override void Flush(System.Collections.IDictionary threadsAndFields, SegmentWriteState state) { System.Collections.IDictionary childThreadsAndFields = new System.Collections.Hashtable(); System.Collections.IDictionary endChildThreadsAndFields = new System.Collections.Hashtable(); System.Collections.IEnumerator it = new System.Collections.Hashtable(threadsAndFields).GetEnumerator(); while (it.MoveNext()) { System.Collections.DictionaryEntry entry = (System.Collections.DictionaryEntry)it.Current; DocInverterPerThread perThread = (DocInverterPerThread)entry.Key; System.Collections.ICollection fields = (System.Collections.ICollection)entry.Value; System.Collections.IEnumerator fieldsIt = fields.GetEnumerator(); System.Collections.Hashtable childFields = new System.Collections.Hashtable(); System.Collections.Hashtable endChildFields = new System.Collections.Hashtable(); while (fieldsIt.MoveNext()) { DocInverterPerField perField = (DocInverterPerField)((System.Collections.DictionaryEntry)fieldsIt.Current).Key; childFields[perField.consumer] = perField.consumer; endChildFields[perField.endConsumer] = perField.endConsumer; } childThreadsAndFields[perThread.consumer] = childFields; endChildThreadsAndFields[perThread.endConsumer] = endChildFields; } consumer.Flush(childThreadsAndFields, state); endConsumer.Flush(endChildThreadsAndFields, state); }
public override void Flush(IDictionary <DocFieldConsumerPerThread, ICollection <DocFieldConsumerPerField> > threadsAndFields, SegmentWriteState state) { var childThreadsAndFields = new HashMap <InvertedDocConsumerPerThread, ICollection <InvertedDocConsumerPerField> >(); var endChildThreadsAndFields = new HashMap <InvertedDocEndConsumerPerThread, ICollection <InvertedDocEndConsumerPerField> >(); foreach (var entry in threadsAndFields) { var perThread = (DocInverterPerThread)entry.Key; ICollection <InvertedDocConsumerPerField> childFields = new HashSet <InvertedDocConsumerPerField>(); ICollection <InvertedDocEndConsumerPerField> endChildFields = new HashSet <InvertedDocEndConsumerPerField>(); foreach (DocFieldConsumerPerField field in entry.Value) { var perField = (DocInverterPerField)field; childFields.Add(perField.consumer); endChildFields.Add(perField.endConsumer); } childThreadsAndFields[perThread.consumer] = childFields; endChildThreadsAndFields[perThread.endConsumer] = endChildFields; } consumer.Flush(childThreadsAndFields, state); endConsumer.Flush(endChildThreadsAndFields, state); }
public override void Flush(Support.Dictionary <DocFieldConsumerPerThread, IList <DocFieldConsumerPerField> > threadsAndFields, SegmentWriteState state) { Support.Dictionary <InvertedDocConsumerPerThread, IList <InvertedDocConsumerPerField> > childThreadsAndFields = new Support.Dictionary <InvertedDocConsumerPerThread, IList <InvertedDocConsumerPerField> >(); Support.Dictionary <InvertedDocEndConsumerPerThread, IList <InvertedDocEndConsumerPerField> > endChildThreadsAndFields = new Support.Dictionary <InvertedDocEndConsumerPerThread, IList <InvertedDocEndConsumerPerField> >(); foreach (KeyValuePair <DocFieldConsumerPerThread, IList <DocFieldConsumerPerField> > entry in new Support.Dictionary <DocFieldConsumerPerThread, IList <DocFieldConsumerPerField> >(threadsAndFields)) { DocInverterPerThread perThread = (DocInverterPerThread)entry.Key; List <InvertedDocConsumerPerField> childFields = new List <InvertedDocConsumerPerField>(); List <InvertedDocEndConsumerPerField> endChildFields = new List <InvertedDocEndConsumerPerField>(); foreach (DocFieldConsumerPerField field in entry.Value) { DocInverterPerField perField = (DocInverterPerField)field; childFields.Add(perField.consumer); endChildFields.Add(perField.endConsumer); } childThreadsAndFields[perThread.consumer] = childFields; endChildThreadsAndFields[perThread.endConsumer] = endChildFields; } consumer.Flush(childThreadsAndFields, state); endConsumer.Flush(endChildThreadsAndFields, state); }
internal override void Flush(IDictionary <string, DocFieldConsumerPerField> fieldsToFlush, SegmentWriteState state) { IDictionary <string, InvertedDocConsumerPerField> childFieldsToFlush = new Dictionary <string, InvertedDocConsumerPerField>(); IDictionary <string, InvertedDocEndConsumerPerField> endChildFieldsToFlush = new Dictionary <string, InvertedDocEndConsumerPerField>(); foreach (KeyValuePair <string, DocFieldConsumerPerField> fieldToFlush in fieldsToFlush) { DocInverterPerField perField = (DocInverterPerField)fieldToFlush.Value; childFieldsToFlush[fieldToFlush.Key] = perField.consumer; endChildFieldsToFlush[fieldToFlush.Key] = perField.endConsumer; } consumer.Flush(childFieldsToFlush, state); endConsumer.Flush(endChildFieldsToFlush, state); }