final class LockedPoolAccessor extends AbstractPoolAccessor<PoolableStore>
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.locks.Lock |
lock |
private long |
size |
sizeOfEngine
Constructor and Description |
---|
LockedPoolAccessor(Pool pool,
PoolableStore store,
SizeOfEngine sizeOfEngine,
long currentSize)
Creates a locked pool accessor with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
protected long |
add(long sizeOf,
boolean force)
Add a specific number of bytes to the pool.
|
protected boolean |
canAddWithoutEvicting(long sizeOf)
Check if there is enough room in the pool to add a specific number of bytes without provoking any eviction
|
long |
delete(long sizeOf)
Delete a fixed number of bytes from the pool.
|
protected void |
doClear()
Free resources used by this accessor.
|
long |
getSize()
Return how many bytes this accessor consumes from the pool.
|
add, canAddWithoutEvicting, checkLinked, clear, getPool, getStore, hasAbortedSizeOf, replace, setMaxSize, unlink
LockedPoolAccessor(Pool pool, PoolableStore store, SizeOfEngine sizeOfEngine, long currentSize)
pool
- pool to be accessedstore
- accessing storesizeOfEngine
- engine used to size objectscurrentSize
- initial size of the storeprotected long add(long sizeOf, boolean force)
add
in class AbstractPoolAccessor<PoolableStore>
sizeOf
- number of bytes to addforce
- true if the pool should accept adding the element, even if it's out of resourcesprotected boolean canAddWithoutEvicting(long sizeOf)
canAddWithoutEvicting
in class AbstractPoolAccessor<PoolableStore>
sizeOf
- number of bytes to test againstpublic long delete(long sizeOf)
sizeOf
- number of bytespublic long getSize()
protected void doClear()
AbstractPoolAccessor.clear()
.doClear
in class AbstractPoolAccessor<PoolableStore>