Esempio n. 1
0
        public TermsHashPerThread(DocInverterPerThread docInverterPerThread, TermsHash termsHash, TermsHash nextTermsHash, TermsHashPerThread primaryPerThread)
        {
            docState = docInverterPerThread.docState;

            this.termsHash = termsHash;
            this.consumer  = termsHash.consumer.AddThread(this);

            if (nextTermsHash != null)
            {
                // We are primary
                charPool = new CharBlockPool(termsHash.docWriter);
                primary  = true;
            }
            else
            {
                charPool = primaryPerThread.charPool;
                primary  = false;
            }

            intPool  = new IntBlockPool(termsHash.docWriter, termsHash.trackAllocations);
            bytePool = new ByteBlockPool(termsHash.docWriter.byteBlockAllocator, termsHash.trackAllocations);

            if (nextTermsHash != null)
            {
                nextPerThread = nextTermsHash.AddThread(docInverterPerThread, this);
            }
            else
            {
                nextPerThread = null;
            }
        }
Esempio n. 2
0
		public TermsHashPerThread(DocInverterPerThread docInverterPerThread, TermsHash termsHash, TermsHash nextTermsHash, TermsHashPerThread primaryPerThread)
		{
			docState = docInverterPerThread.docState;
			
			this.termsHash = termsHash;
			this.consumer = termsHash.consumer.AddThread(this);
			
			if (nextTermsHash != null)
			{
				// We are primary
				charPool = new CharBlockPool(termsHash.docWriter);
				primary = true;
			}
			else
			{
				charPool = primaryPerThread.charPool;
				primary = false;
			}
			
			intPool = new IntBlockPool(termsHash.docWriter, termsHash.trackAllocations);
			bytePool = new ByteBlockPool(termsHash.docWriter.byteBlockAllocator, termsHash.trackAllocations);
			
			if (nextTermsHash != null)
				nextPerThread = nextTermsHash.AddThread(docInverterPerThread, this);
			else
				nextPerThread = null;
		}
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
		public DocInverterPerField(DocInverterPerThread perThread, FieldInfo fieldInfo)
		{
			this.perThread = perThread;
			this.fieldInfo = fieldInfo;
			docState = perThread.docState;
			fieldState = perThread.fieldState;
			this.consumer = perThread.consumer.AddField(this, fieldInfo);
			this.endConsumer = perThread.endConsumer.AddField(this, fieldInfo);
		}
Esempio n. 5
0
 public DocInverterPerField(DocInverterPerThread perThread, FieldInfo fieldInfo)
 {
     this.perThread   = perThread;
     this.fieldInfo   = fieldInfo;
     docState         = perThread.docState;
     fieldState       = perThread.fieldState;
     this.consumer    = perThread.consumer.AddField(this, fieldInfo);
     this.endConsumer = perThread.endConsumer.AddField(this, fieldInfo);
 }
Esempio n. 6
0
		internal override InvertedDocConsumerPerThread AddThread(DocInverterPerThread docInverterPerThread)
		{
			return new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, null);
		}
Esempio n. 7
0
		public NormsWriterPerThread(DocInverterPerThread docInverterPerThread, NormsWriter normsWriter)
		{
			this.normsWriter = normsWriter;
			docState = docInverterPerThread.docState;
		}
Esempio n. 8
0
 internal TermsHashPerThread AddThread(DocInverterPerThread docInverterPerThread, TermsHashPerThread primaryPerThread)
 {
     return(new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, primaryPerThread));
 }
Esempio n. 9
0
 internal override InvertedDocConsumerPerThread AddThread(DocInverterPerThread docInverterPerThread)
 {
     return(new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, null));
 }
Esempio n. 10
0
 /// <summary>Add a new thread </summary>
 internal abstract InvertedDocConsumerPerThread AddThread(DocInverterPerThread docInverterPerThread);
Esempio n. 11
0
		public override InvertedDocEndConsumerPerThread AddThread(DocInverterPerThread docInverterPerThread)
		{
			return new NormsWriterPerThread(docInverterPerThread, this);
		}
Esempio n. 12
0
 public abstract InvertedDocEndConsumerPerThread AddThread(DocInverterPerThread docInverterPerThread);
Esempio n. 13
0
 public NormsWriterPerThread(DocInverterPerThread docInverterPerThread, NormsWriter normsWriter)
 {
     this.normsWriter = normsWriter;
     docState         = docInverterPerThread.docState;
 }
Esempio n. 14
0
		internal TermsHashPerThread AddThread(DocInverterPerThread docInverterPerThread, TermsHashPerThread primaryPerThread)
		{
			return new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, primaryPerThread);
		}
Esempio n. 15
0
		/// <summary>Add a new thread </summary>
		internal abstract InvertedDocConsumerPerThread AddThread(DocInverterPerThread docInverterPerThread);
Esempio n. 16
0
 public override InvertedDocEndConsumerPerThread AddThread(DocInverterPerThread docInverterPerThread)
 {
     return(new NormsWriterPerThread(docInverterPerThread, this));
 }
Esempio n. 17
0
		public abstract InvertedDocEndConsumerPerThread AddThread(DocInverterPerThread docInverterPerThread);