Class RecyclingInt32BlockAllocator
A Int32BlockPool.Allocator implementation that recycles unused int blocks in a buffer and reuses them in subsequent calls to GetInt32Block().
Note: this class is not thread-safe.
NOTE: This was RecyclingIntBlockAllocator in Lucene
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public sealed class RecyclingInt32BlockAllocator : Int32BlockPool.Allocator
Constructors
RecyclingInt32BlockAllocator()
Creates a new RecyclingInt32BlockAllocator with a block size of INT32_BLOCK_SIZE, upper buffered docs limit of DEFAULT_BUFFERED_BLOCKS.
Declaration
public RecyclingInt32BlockAllocator()
RecyclingInt32BlockAllocator(int, int)
Creates a new RecyclingInt32BlockAllocator.
Declaration
public RecyclingInt32BlockAllocator(int blockSize, int maxBufferedBlocks)
Parameters
Type | Name | Description |
---|---|---|
int | blockSize | The size of each block returned by this allocator. |
int | maxBufferedBlocks | Maximum number of buffered int blocks. |
RecyclingInt32BlockAllocator(int, int, Counter)
Creates a new RecyclingInt32BlockAllocator.
Declaration
public RecyclingInt32BlockAllocator(int blockSize, int maxBufferedBlocks, Counter bytesUsed)
Parameters
Type | Name | Description |
---|---|---|
int | blockSize | The block size in bytes. |
int | maxBufferedBlocks | Maximum number of buffered int block. |
Counter | bytesUsed | Counter reference counting internally allocated bytes. |
Fields
DEFAULT_BUFFERED_BLOCKS
A Int32BlockPool.Allocator implementation that recycles unused int blocks in a buffer and reuses them in subsequent calls to GetInt32Block().
Note: this class is not thread-safe.
NOTE: This was RecyclingIntBlockAllocator in Lucene
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public const int DEFAULT_BUFFERED_BLOCKS = 64
Field Value
Type | Description |
---|---|
int |
Properties
BytesUsed
A Int32BlockPool.Allocator implementation that recycles unused int blocks in a buffer and reuses them in subsequent calls to GetInt32Block().
Note: this class is not thread-safe.
NOTE: This was RecyclingIntBlockAllocator in Lucene
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public long BytesUsed { get; }
Property Value
Type | Description |
---|---|
long | The number of bytes currently allocated by this Int32BlockPool.Allocator. |
MaxBufferedBlocks
A Int32BlockPool.Allocator implementation that recycles unused int blocks in a buffer and reuses them in subsequent calls to GetInt32Block().
Note: this class is not thread-safe.
NOTE: This was RecyclingIntBlockAllocator in Lucene
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public int MaxBufferedBlocks { get; }
Property Value
Type | Description |
---|---|
int | The maximum number of buffered byte blocks. |
NumBufferedBlocks
A Int32BlockPool.Allocator implementation that recycles unused int blocks in a buffer and reuses them in subsequent calls to GetInt32Block().
Note: this class is not thread-safe.
NOTE: This was RecyclingIntBlockAllocator in Lucene
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public int NumBufferedBlocks { get; }
Property Value
Type | Description |
---|---|
int | The number of currently buffered blocks. |
Methods
FreeBlocks(int)
Removes the given number of int blocks from the buffer if possible.
Declaration
public int FreeBlocks(int num)
Parameters
Type | Name | Description |
---|---|---|
int | num | The number of int blocks to remove. |
Returns
Type | Description |
---|---|
int | The number of actually removed buffers. |
GetInt32Block()
NOTE: This was getIntBlock() in Lucene
Declaration
public override int[] GetInt32Block()
Returns
Type | Description |
---|---|
int[] |
Overrides
RecycleInt32Blocks(int[][], int, int)
NOTE: This was recycleIntBlocks in Lucene
Declaration
public override void RecycleInt32Blocks(int[][] blocks, int start, int end)
Parameters
Type | Name | Description |
---|---|---|
int[][] | blocks | |
int | start | |
int | end |