Esempio n. 1
0
        public override void Flush(IDictionary <DocFieldConsumerPerThread, ICollection <DocFieldConsumerPerField> > threadsAndFields, SegmentWriteState state)
        {
            var oneThreadsAndFields = new HashMap <DocFieldConsumerPerThread, ICollection <DocFieldConsumerPerField> >();
            var twoThreadsAndFields = new HashMap <DocFieldConsumerPerThread, ICollection <DocFieldConsumerPerField> >();

            foreach (var entry in threadsAndFields)
            {
                DocFieldConsumersPerThread             perThread = (DocFieldConsumersPerThread)entry.Key;
                ICollection <DocFieldConsumerPerField> fields    = entry.Value;

                IEnumerator <DocFieldConsumerPerField> fieldsIt  = fields.GetEnumerator();
                ICollection <DocFieldConsumerPerField> oneFields = new HashSet <DocFieldConsumerPerField>();
                ICollection <DocFieldConsumerPerField> twoFields = new HashSet <DocFieldConsumerPerField>();
                while (fieldsIt.MoveNext())
                {
                    DocFieldConsumersPerField perField = (DocFieldConsumersPerField)fieldsIt.Current;
                    oneFields.Add(perField.one);
                    twoFields.Add(perField.two);
                }

                oneThreadsAndFields[perThread.one] = oneFields;
                twoThreadsAndFields[perThread.two] = twoFields;
            }


            one.Flush(oneThreadsAndFields, state);
            two.Flush(twoThreadsAndFields, state);
        }
 public DocFieldConsumersPerField(DocFieldConsumersPerThread perThread, DocFieldConsumerPerField one, DocFieldConsumerPerField two)
 {
     this.perThread = perThread;
     this.one       = one;
     this.two       = two;
 }
		public DocFieldConsumersPerField(DocFieldConsumersPerThread perThread, DocFieldConsumerPerField one, DocFieldConsumerPerField two)
		{
			this.perThread = perThread;
			this.one = one;
			this.two = two;
		}