Package net.rubyeye.xmemcached.buffer
Class CachedBufferAllocator
- java.lang.Object
-
- net.rubyeye.xmemcached.buffer.CachedBufferAllocator
-
- All Implemented Interfaces:
BufferAllocator
@Deprecated public class CachedBufferAllocator extends java.lang.Object implements BufferAllocator
Deprecated.Cached IoBuffer allocator,cached buffer in ThreadLocal.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCachedBufferAllocator.CachedIoBufferDeprecated.
-
Field Summary
Fields Modifier and Type Field Description private static intDEFAULT_MAX_CACHED_BUFFER_SIZEDeprecated.private static intDEFAULT_MAX_POOL_SIZEDeprecated.private IoBufferEMPTY_IO_BUFFERDeprecated.private java.lang.ThreadLocal<java.util.Map<java.lang.Integer,java.util.Queue<CachedBufferAllocator.CachedIoBuffer>>>heapBuffersDeprecated.private intmaxCachedBufferSizeDeprecated.private intmaxPoolSizeDeprecated.
-
Constructor Summary
Constructors Constructor Description CachedBufferAllocator()Deprecated.Creates a new instance with the default parameters (#DEFAULT_MAX_POOL_SIZE and #DEFAULT_MAX_CACHED_BUFFER_SIZE).CachedBufferAllocator(int maxPoolSize, int maxCachedBufferSize)Deprecated.Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IoBufferallocate(int requestedCapacity)Deprecated.voiddispose()Deprecated.intgetMaxCachedBufferSize()Deprecated.intgetMaxPoolSize()Deprecated.static BufferAllocatornewInstance()Deprecated.static BufferAllocatornewInstance(int maxPoolSize, int maxCachedBufferSize)Deprecated.private java.util.Map<java.lang.Integer,java.util.Queue<CachedBufferAllocator.CachedIoBuffer>>newPoolMap()Deprecated.初始化缓冲池IoBufferwrap(java.nio.ByteBuffer nioBuffer)Deprecated.
-
-
-
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.
-
heapBuffers
private final java.lang.ThreadLocal<java.util.Map<java.lang.Integer,java.util.Queue<CachedBufferAllocator.CachedIoBuffer>>> heapBuffers
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.
-
newPoolMap
private java.util.Map<java.lang.Integer,java.util.Queue<CachedBufferAllocator.CachedIoBuffer>> newPoolMap()
Deprecated.初始化缓冲池- Returns:
-
allocate
public final IoBuffer allocate(int requestedCapacity)
Deprecated.- Specified by:
allocatein interfaceBufferAllocator
-
wrap
public final IoBuffer wrap(java.nio.ByteBuffer nioBuffer)
Deprecated.- Specified by:
wrapin interfaceBufferAllocator
-
dispose
public void dispose()
Deprecated.- Specified by:
disposein interfaceBufferAllocator
-
newInstance
public static BufferAllocator newInstance()
Deprecated.
-
newInstance
public static BufferAllocator newInstance(int maxPoolSize, int maxCachedBufferSize)
Deprecated.
-
-