Exemple #1
0
        public void  Init(ByteBlockPool pool, int startIndex, int endIndex)
        {
            System.Diagnostics.Debug.Assert(endIndex - startIndex >= 0);
            System.Diagnostics.Debug.Assert(startIndex >= 0);
            System.Diagnostics.Debug.Assert(endIndex >= 0);

            this.pool     = pool;
            this.endIndex = endIndex;

            level        = 0;
            bufferUpto   = startIndex / DocumentsWriter.BYTE_BLOCK_SIZE;
            bufferOffset = bufferUpto * DocumentsWriter.BYTE_BLOCK_SIZE;
            buffer       = pool.buffers[bufferUpto];
            upto         = startIndex & DocumentsWriter.BYTE_BLOCK_MASK;

            int firstSize = ByteBlockPool.levelSizeArray[0];

            if (startIndex + firstSize >= endIndex)
            {
                // There is only this one slice to read
                limit = endIndex & DocumentsWriter.BYTE_BLOCK_MASK;
            }
            else
            {
                limit = upto + firstSize - 4;
            }
        }
		public void  Init(ByteBlockPool pool, int startIndex, int endIndex)
		{
			
			System.Diagnostics.Debug.Assert(endIndex - startIndex >= 0);
			System.Diagnostics.Debug.Assert(startIndex >= 0);
			System.Diagnostics.Debug.Assert(endIndex >= 0);
			
			this.pool = pool;
			this.endIndex = endIndex;
			
			level = 0;
			bufferUpto = startIndex / DocumentsWriter.BYTE_BLOCK_SIZE;
			bufferOffset = bufferUpto * DocumentsWriter.BYTE_BLOCK_SIZE;
			buffer = pool.buffers[bufferUpto];
			upto = startIndex & DocumentsWriter.BYTE_BLOCK_MASK;
			
			int firstSize = ByteBlockPool.levelSizeArray[0];
			
			if (startIndex + firstSize >= endIndex)
			{
				// There is only this one slice to read
				limit = endIndex & DocumentsWriter.BYTE_BLOCK_MASK;
			}
			else
				limit = upto + firstSize - 4;
		}
		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;
     }
 }
Exemple #5
0
 public ByteSliceWriter(ByteBlockPool pool)
 {
     this.pool = pool;
 }
		public ByteSliceWriter(ByteBlockPool pool)
		{
			this.pool = pool;
		}