T
- Type representing this "other" side of this accessor (i.e. a store), so the evictor can interact with itpublic interface PoolAccessor<T extends PoolParticipant>
Modifier and Type | Method and Description |
---|---|
long |
add(Object key,
Object value,
Object container,
boolean force)
Add an element to the pool.
|
boolean |
canAddWithoutEvicting(Object key,
Object value,
Object container)
Check if there is enough room in the pool to add an element without provoking any eviction
|
void |
clear()
Free resources used by this accessor.
|
long |
delete(long size)
Delete a fixed number of bytes from the pool.
|
T |
getParticipant()
Return the store that uses this accessor
|
long |
getPoolOccupancy()
Returns the occupied size for this pool.
|
long |
getPoolSize()
Returns the size of this pool.
|
long |
getSize()
Return how many bytes this accessor consumes from the pool.
|
boolean |
hasAbortedSizeOf()
Check if the store may contain elements which the SizeOf engine could not fully size.
|
long |
replace(long currentSize,
Object key,
Object value,
Object container,
boolean force)
Delete a fixed number of bytes from the pool with the given objects.
|
void |
setMaxSize(long newValue)
Sets the max size for this pool
|
void |
unlink()
unlink this PoolAccessor from its pool.
|
long add(Object key, Object value, Object container, boolean force)
key
- the key of the elementvalue
- the value of the elementcontainer
- the element-container objectforce
- true if the pool should accept adding the element, even if it's out of resourcesboolean canAddWithoutEvicting(Object key, Object value, Object container)
key
- the key of the elementvalue
- the value of the elementcontainer
- the element-container objectlong delete(long size) throws IllegalArgumentException
size
- number of bytesIllegalArgumentException
- when sizeOf is negativelong replace(long currentSize, Object key, Object value, Object container, boolean force)
currentSize
- the size of the object(s) being replacedkey
- the key of the elementvalue
- the value of the elementcontainer
- the element-container objectforce
- true if the pool should accept replacing the element, even if it's out of resourcesLong.MIN_VALUE
if replace failed.long getSize()
void unlink()
void clear()
T getParticipant()
void setMaxSize(long newValue)
newValue
- the value in byteslong getPoolOccupancy()
long getPoolSize()
boolean hasAbortedSizeOf()
Copyright © 2003–2016 Terracotta, Inc.. All rights reserved.