Class CachedBufferAllocator

  • All Implemented Interfaces:
    BufferAllocator

    @Deprecated
    public class CachedBufferAllocator
    extends java.lang.Object
    implements BufferAllocator
    Deprecated.
    Cached IoBuffer allocator,cached buffer in ThreadLocal.
    • Field Detail

      • DEFAULT_MAX_POOL_SIZE

        private static final int DEFAULT_MAX_POOL_SIZE
        Deprecated.
        See Also:
        Constant Field Values
      • DEFAULT_MAX_CACHED_BUFFER_SIZE

        private static final int DEFAULT_MAX_CACHED_BUFFER_SIZE
        Deprecated.
        See Also:
        Constant Field Values
      • maxPoolSize

        private final int maxPoolSize
        Deprecated.
      • maxCachedBufferSize

        private final int maxCachedBufferSize
        Deprecated.
      • EMPTY_IO_BUFFER

        private final IoBuffer EMPTY_IO_BUFFER
        Deprecated.
    • Constructor Detail

      • CachedBufferAllocator

        public CachedBufferAllocator()
        Deprecated.
        Creates a new instance with the default parameters (#DEFAULT_MAX_POOL_SIZE and #DEFAULT_MAX_CACHED_BUFFER_SIZE).
      • CachedBufferAllocator

        public CachedBufferAllocator​(int maxPoolSize,
                                     int maxCachedBufferSize)
        Deprecated.
        Creates a new instance.
        Parameters:
        maxPoolSize - the maximum number of buffers with the same capacity per thread. 0 disables this limitation.
        maxCachedBufferSize - the maximum capacity of a cached buffer. A buffer whose capacity is bigger than this value is not pooled. 0 disables this limitation.
    • Method Detail

      • getMaxPoolSize

        public int getMaxPoolSize()
        Deprecated.
      • getMaxCachedBufferSize

        public int getMaxCachedBufferSize()
        Deprecated.
      • newInstance

        public static BufferAllocator newInstance​(int maxPoolSize,
                                                  int maxCachedBufferSize)
        Deprecated.