Show / Hide Table of Contents

    Class RecyclingByteBlockAllocator

    A ByteBlockPool.Allocator implementation that recycles unused byte blocks in a buffer and reuses them in subsequent calls to GetByteBlock().

    Note: this class is not thread-safe.

    This is a Lucene.NET INTERNAL API, use at your own risk
    Inheritance
    System.Object
    ByteBlockPool.Allocator
    RecyclingByteBlockAllocator
    Inherited Members
    ByteBlockPool.Allocator.m_blockSize
    ByteBlockPool.Allocator.RecycleByteBlocks(IList<Byte[]>)
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class RecyclingByteBlockAllocator : ByteBlockPool.Allocator

    Constructors

    | Improve this Doc View Source

    RecyclingByteBlockAllocator()

    Creates a new RecyclingByteBlockAllocator with a block size of BYTE_BLOCK_SIZE, upper buffered docs limit of DEFAULT_BUFFERED_BLOCKS (64).

    Declaration
    public RecyclingByteBlockAllocator()
    | Improve this Doc View Source

    RecyclingByteBlockAllocator(Int32, Int32)

    Creates a new RecyclingByteBlockAllocator.

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

    The block size in bytes.

    System.Int32 maxBufferedBlocks

    Maximum number of buffered byte block.

    | Improve this Doc View Source

    RecyclingByteBlockAllocator(Int32, Int32, Counter)

    Creates a new RecyclingByteBlockAllocator

    Declaration
    public RecyclingByteBlockAllocator(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 byte 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 ByteBlockPool.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 byte blocks from the buffer if possible.

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

    The number of byte blocks to remove.

    Returns
    Type Description
    System.Int32

    The number of actually removed buffers.

    | Improve this Doc View Source

    GetByteBlock()

    Declaration
    public override byte[] GetByteBlock()
    Returns
    Type Description
    System.Byte[]
    Overrides
    ByteBlockPool.Allocator.GetByteBlock()
    | Improve this Doc View Source

    RecycleByteBlocks(Byte[][], Int32, Int32)

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