示例#1
0
 /// <summary>
 /// Creates a new <see cref="BytesRefHash"/>
 /// </summary>
 public BytesRefHash(ByteBlockPool pool, int capacity, BytesStartArray bytesStartArray)
 {
     hashSize     = capacity;
     hashHalfSize = hashSize >> 1;
     hashMask     = hashSize - 1;
     this.pool    = pool;
     ids          = new int[hashSize];
     Arrays.Fill(ids, -1);
     this.bytesStartArray = bytesStartArray;
     bytesStart           = bytesStartArray.Init();
     bytesUsed            = bytesStartArray.BytesUsed() ?? Counter.NewCounter();
     bytesUsed.AddAndGet(hashSize * RamUsageEstimator.NUM_BYTES_INT32);
 }
示例#2
0
 public DirectBytesStartArray(int initSize)
     : this(initSize, Counter.NewCounter())
 {
 }
示例#3
0
 /// <summary>
 /// Creates a new <see cref="RecyclingInt32BlockAllocator"/> with a block size of
 /// <see cref="Int32BlockPool.INT32_BLOCK_SIZE"/>, upper buffered docs limit of
 /// <see cref="DEFAULT_BUFFERED_BLOCKS"/>.
 /// </summary>
 public RecyclingInt32BlockAllocator()
     : this(Int32BlockPool.INT32_BLOCK_SIZE, 64, Counter.NewCounter(false))
 {
 }
示例#4
0
 /// <summary>
 /// Creates a new <see cref="RecyclingInt32BlockAllocator"/>.
 /// </summary>
 /// <param name="blockSize">
 ///          The size of each block returned by this allocator. </param>
 /// <param name="maxBufferedBlocks">
 ///          Maximum number of buffered int blocks. </param>
 public RecyclingInt32BlockAllocator(int blockSize, int maxBufferedBlocks)
     : this(blockSize, maxBufferedBlocks, Counter.NewCounter(false))
 {
 }
 /// <summary>
 /// Creates a new <see cref="RecyclingByteBlockAllocator"/> with a block size of
 /// <see cref="ByteBlockPool.BYTE_BLOCK_SIZE"/>, upper buffered docs limit of
 /// <see cref="DEFAULT_BUFFERED_BLOCKS"/> (64).
 /// </summary>
 public RecyclingByteBlockAllocator()
     : this(ByteBlockPool.BYTE_BLOCK_SIZE, 64, Counter.NewCounter(false))
 {
 }