T
- type of the store that uses this accessorpublic interface PoolAccessor<T>
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.
|
long |
getSize()
Return how many bytes this accessor consumes from the pool.
|
T |
getStore()
Return the store that uses this accessor
|
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)
size
- number of byteslong 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 getSize()
void unlink()
void clear()
T getStore()
void setMaxSize(long newValue)
newValue
- the value in bytesboolean hasAbortedSizeOf()
Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.