Package net.rubyeye.xmemcached.buffer
Class CachedBufferAllocator
java.lang.Object
net.rubyeye.xmemcached.buffer.CachedBufferAllocator
- All Implemented Interfaces:
BufferAllocator
Deprecated.
Cached IoBuffer allocator,cached buffer in ThreadLocal.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intDeprecated.private static final intDeprecated.private final IoBufferDeprecated.private final ThreadLocal<Map<Integer, Queue<CachedBufferAllocator.CachedIoBuffer>>> Deprecated.private final intDeprecated.private final intDeprecated. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.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
Modifier and TypeMethodDescriptionfinal IoBufferallocate(int requestedCapacity) Deprecated.voiddispose()Deprecated.intDeprecated.intDeprecated.static BufferAllocatorDeprecated.static BufferAllocatornewInstance(int maxPoolSize, int maxCachedBufferSize) Deprecated.private Map<Integer, Queue<CachedBufferAllocator.CachedIoBuffer>> Deprecated.初始化缓冲池final IoBufferwrap(ByteBuffer nioBuffer) Deprecated.
-
Field Details
-
DEFAULT_MAX_POOL_SIZE
private static final int DEFAULT_MAX_POOL_SIZEDeprecated.- See Also:
-
DEFAULT_MAX_CACHED_BUFFER_SIZE
private static final int DEFAULT_MAX_CACHED_BUFFER_SIZEDeprecated.- See Also:
-
maxPoolSize
private final int maxPoolSizeDeprecated. -
maxCachedBufferSize
private final int maxCachedBufferSizeDeprecated. -
heapBuffers
Deprecated. -
EMPTY_IO_BUFFER
Deprecated.
-
-
Constructor Details
-
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 Details
-
getMaxPoolSize
public int getMaxPoolSize()Deprecated. -
getMaxCachedBufferSize
public int getMaxCachedBufferSize()Deprecated. -
newPoolMap
Deprecated.初始化缓冲池- Returns:
-
allocate
Deprecated.- Specified by:
allocatein interfaceBufferAllocator
-
wrap
Deprecated.- Specified by:
wrapin interfaceBufferAllocator
-
dispose
public void dispose()Deprecated.- Specified by:
disposein interfaceBufferAllocator
-
newInstance
Deprecated. -
newInstance
Deprecated.
-