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 int
Deprecated.private static final int
Deprecated.private final IoBuffer
Deprecated.private final ThreadLocal
<Map<Integer, Queue<CachedBufferAllocator.CachedIoBuffer>>> Deprecated.private final int
Deprecated.private final int
Deprecated. -
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 IoBuffer
allocate
(int requestedCapacity) Deprecated.void
dispose()
Deprecated.int
Deprecated.int
Deprecated.static BufferAllocator
Deprecated.static BufferAllocator
newInstance
(int maxPoolSize, int maxCachedBufferSize) Deprecated.private Map
<Integer, Queue<CachedBufferAllocator.CachedIoBuffer>> Deprecated.初始化缓冲池final IoBuffer
wrap
(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:
allocate
in interfaceBufferAllocator
-
wrap
Deprecated.- Specified by:
wrap
in interfaceBufferAllocator
-
dispose
public void dispose()Deprecated.- Specified by:
dispose
in interfaceBufferAllocator
-
newInstance
Deprecated. -
newInstance
Deprecated.
-