Fork me on GitHub
  • API

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Inheritance
    object
    ByteBlockPool.Allocator
    RecyclingByteBlockAllocator
    Inherited Members
    ByteBlockPool.Allocator.RecycleByteBlocks(IList<byte[]>)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class RecyclingByteBlockAllocator : ByteBlockPool.Allocator

    Constructors

    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()

    RecyclingByteBlockAllocator(int, int)

    Creates a new RecyclingByteBlockAllocator.

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

    The block size in bytes.

    int maxBufferedBlocks

    Maximum number of buffered byte block.

    RecyclingByteBlockAllocator(int, int, Counter)

    Creates a new RecyclingByteBlockAllocator

    Declaration
    public RecyclingByteBlockAllocator(int blockSize, int maxBufferedBlocks, Counter bytesUsed)
    Parameters
    Type Name Description
    int blockSize

    The block size in bytes.

    int maxBufferedBlocks

    Maximum number of buffered byte block.

    Counter bytesUsed

    Counter reference counting internally allocated bytes.

    Fields

    DEFAULT_BUFFERED_BLOCKS

    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.

    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 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.

    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 ByteBlockPool.Allocator.

    MaxBufferedBlocks

    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.

    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 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.

    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 byte blocks from the buffer if possible.

    Declaration
    public int FreeBlocks(int num)
    Parameters
    Type Name Description
    int num

    The number of byte blocks to remove.

    Returns
    Type Description
    int

    The number of actually removed buffers.

    GetByteBlock()

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public override byte[] GetByteBlock()
    Returns
    Type Description
    byte[]
    Overrides
    ByteBlockPool.Allocator.GetByteBlock()

    RecycleByteBlocks(byte[][], int, int)

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public override void RecycleByteBlocks(byte[][] blocks, int start, int end)
    Parameters
    Type Name Description
    byte[][] blocks
    int start
    int end
    Overrides
    ByteBlockPool.Allocator.RecycleByteBlocks(byte[][], int, int)
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.