Package com.tangosol.io.journal
Class FlashJournalRM.BufferPool
- java.lang.Object
-
- com.tangosol.io.journal.FlashJournalRM.BufferPool
-
- Enclosing class:
- FlashJournalRM
protected static class FlashJournalRM.BufferPool extends Object
The BufferPool class recycles up to a maximum number of Buffer objects.
-
-
Constructor Summary
Constructors Constructor Description BufferPool(int cbBuffer, int cMaxBuffers)
Instantiate a buffer pool to provide buffers to the journal appending process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlashJournalRM.Buffer
allocate(byte[] abOv)
Allocate a buffer from the buffer pool.int
getSize()
Determine the current size of the pool.void
release(FlashJournalRM.Buffer buf)
Return a buffer to the pool.String
toString()
-
-
-
Method Detail
-
allocate
public FlashJournalRM.Buffer allocate(byte[] abOv)
Allocate a buffer from the buffer pool.- Parameters:
abOv
- the overlay byte[]- Returns:
- a Buffer instance
-
release
public void release(FlashJournalRM.Buffer buf)
Return a buffer to the pool. Note that this isn't a precisely limited pool; it's possible that it could hold slightly more than the maximum size due to the avoidance of synchronization.- Parameters:
buf
- the Buffer to return to the pool
-
getSize
public int getSize()
Determine the current size of the pool.- Returns:
- the number of buffers in the pool
-
-