org.elasticsearch.cache.memory
Class ByteBufferCache
java.lang.Object
org.elasticsearch.common.component.AbstractComponent
org.elasticsearch.cache.memory.ByteBufferCache
- All Implemented Interfaces:
- ByteBufferAllocator
public class ByteBufferCache
- extends AbstractComponent
- implements ByteBufferAllocator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteBufferCache
public ByteBufferCache()
ByteBufferCache
public ByteBufferCache(int bufferSizeInBytes,
int cacheSizeInBytes,
boolean direct)
ByteBufferCache
@Inject
public ByteBufferCache(Settings settings)
direct
public boolean direct()
close
public void close()
- Description copied from interface:
ByteBufferAllocator
- Close the allocator, releasing any cached buffers for example.
- Specified by:
close
in interface ByteBufferAllocator
sizeInBytes
public int sizeInBytes(ByteBufferAllocator.Type type)
- Description copied from interface:
ByteBufferAllocator
- The size (in bytes) that is allocated for the provided type.
- Specified by:
sizeInBytes
in interface ByteBufferAllocator
allocate
public java.nio.ByteBuffer allocate(ByteBufferAllocator.Type type)
throws java.io.IOException
- Description copied from interface:
ByteBufferAllocator
- Allocate a byte buffer for the specific type.
- Specified by:
allocate
in interface ByteBufferAllocator
- Throws:
java.io.IOException
release
public void release(java.nio.ByteBuffer buffer)
- Description copied from interface:
ByteBufferAllocator
- Release the buffer.
- Specified by:
release
in interface ByteBufferAllocator