Show / Hide Table of Contents

    Class RecyclingInt32BlockAllocator

    A Int32BlockPool.Allocator implementation that recycles unused 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

    This is a Lucene.NET INTERNAL API, use at your own risk
    Inheritance
    System.Object
    Int32BlockPool.Allocator
    RecyclingInt32BlockAllocator
    Inherited Members
    Int32BlockPool.Allocator.m_blockSize
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class RecyclingInt32BlockAllocator : Int32BlockPool.Allocator

    Constructors

    | Improve this Doc View Source

    RecyclingInt32BlockAllocator()

    Creates a new RecyclingInt32BlockAllocator with a block size of INT32_BLOCK_SIZE, upper buffered docs limit of DEFAULT_BUFFERED_BLOCKS.

    Declaration
    public RecyclingInt32BlockAllocator()
    | Improve this Doc View Source

    RecyclingInt32BlockAllocator(Int32, Int32)

    Creates a new RecyclingInt32BlockAllocator.

    Declaration
    public RecyclingInt32BlockAllocator(int blockSize, int maxBufferedBlocks)
    Parameters
    Type Name Description
    System.Int32 blockSize

    The size of each block returned by this allocator.

    System.Int32 maxBufferedBlocks

    Maximum number of buffered int blocks.

    | Improve this Doc View Source

    RecyclingInt32BlockAllocator(Int32, Int32, Counter)

    Creates a new RecyclingInt32BlockAllocator.

    Declaration
    public RecyclingInt32BlockAllocator(int blockSize, int maxBufferedBlocks, Counter bytesUsed)
    Parameters
    Type Name Description
    System.Int32 blockSize

    The block size in bytes.

    System.Int32 maxBufferedBlocks

    Maximum number of buffered int block.

    Counter bytesUsed

    Counter reference counting internally allocated bytes.

    Fields

    | Improve this Doc View Source

    DEFAULT_BUFFERED_BLOCKS

    Declaration
    public const int DEFAULT_BUFFERED_BLOCKS = null
    Field Value
    Type Description
    System.Int32

    Properties

    | Improve this Doc View Source

    BytesUsed

    Declaration
    public long BytesUsed { get; }
    Property Value
    Type Description
    System.Int64

    The number of bytes currently allocated by this Int32BlockPool.Allocator.

    | Improve this Doc View Source

    MaxBufferedBlocks

    Declaration
    public int MaxBufferedBlocks { get; }
    Property Value
    Type Description
    System.Int32

    The maximum number of buffered byte blocks.

    | Improve this Doc View Source

    NumBufferedBlocks

    Declaration
    public int NumBufferedBlocks { get; }
    Property Value
    Type Description
    System.Int32

    The number of currently buffered blocks.

    Methods

    | Improve this Doc View Source

    FreeBlocks(Int32)

    Removes the given number of int blocks from the buffer if possible.

    Declaration
    public int FreeBlocks(int num)
    Parameters
    Type Name Description
    System.Int32 num

    The number of int blocks to remove.

    Returns
    Type Description
    System.Int32

    The number of actually removed buffers.

    | Improve this Doc View Source

    GetInt32Block()

    NOTE: This was getIntBlock() in Lucene

    Declaration
    public override int[] GetInt32Block()
    Returns
    Type Description
    System.Int32[]
    Overrides
    Int32BlockPool.Allocator.GetInt32Block()
    | Improve this Doc View Source

    RecycleInt32Blocks(Int32[][], Int32, Int32)

    NOTE: This was recycleIntBlocks in Lucene

    Declaration
    public override void RecycleInt32Blocks(int[][] blocks, int start, int end)
    Parameters
    Type Name Description
    System.Int32[][] blocks
    System.Int32 start
    System.Int32 end
    Overrides
    Int32BlockPool.Allocator.RecycleInt32Blocks(Int32[][], Int32, Int32)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)