SimpleCachedBufferPool (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.db.commitlog

## Class SimpleCachedBufferPool

- java.lang.Object
- - org.apache.cassandra.db.commitlog.SimpleCachedBufferPool

-     public class SimpleCachedBufferPool
      extends java.lang.Object

  A very simple Bytebuffer pool with a fixed allocation size and a cached max allocation count. Will allow you to go past the "max", freeing all buffers allocated beyond the max buffer count on release. Has a reusable thread local ByteBuffer that users can make use of.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static io.netty.util.concurrent.FastThreadLocal<java.nio.ByteBuffer>` | `reusableBufferHolder`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleCachedBufferPool(int maxBufferPoolSize, int bufferSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `atLimit()`
    `java.nio.ByteBuffer` | `createBuffer(BufferType bufferType)`
    `java.nio.ByteBuffer` | `getThreadLocalReusableBuffer(int size)`
    `void` | `releaseBuffer(java.nio.ByteBuffer buffer)`
    `void` | `setPreferredReusableBufferType(BufferType type)`
    `void` | `shutdown()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### reusableBufferHolder

          protected static final io.netty.util.concurrent.FastThreadLocal<java.nio.ByteBuffer> reusableBufferHolder

  - ### Constructor Detail

    - #### SimpleCachedBufferPool

          public SimpleCachedBufferPool(int maxBufferPoolSize,
                                        int bufferSize)

  - ### Method Detail

    - #### createBuffer

          public java.nio.ByteBuffer createBuffer(BufferType bufferType)

    - #### getThreadLocalReusableBuffer

          public java.nio.ByteBuffer getThreadLocalReusableBuffer(int size)

    - #### setPreferredReusableBufferType

          public void setPreferredReusableBufferType(BufferType type)

    - #### releaseBuffer

          public void releaseBuffer(java.nio.ByteBuffer buffer)

    - #### shutdown

          public void shutdown()

    - #### atLimit

          public boolean atLimit()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2018 The Apache Software Foundation