private final class UnboundedPool.UnboundedPoolAccessor extends java.lang.Object implements PoolAccessor
Modifier | Constructor and Description |
---|---|
private |
UnboundedPoolAccessor() |
Modifier and Type | Method and Description |
---|---|
long |
add(java.lang.Object key,
java.lang.Object value,
java.lang.Object container,
boolean force)
Add an element to the pool.
|
boolean |
canAddWithoutEvicting(java.lang.Object key,
java.lang.Object value,
java.lang.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 sizeOf)
Delete a fixed number of bytes from the pool.
|
long |
getSize()
Return how many bytes this accessor consumes from the pool.
|
java.lang.Object |
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,
java.lang.Object key,
java.lang.Object value,
java.lang.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.
|
public long add(java.lang.Object key, java.lang.Object value, java.lang.Object container, boolean force)
add
in interface PoolAccessor
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 resourcespublic boolean canAddWithoutEvicting(java.lang.Object key, java.lang.Object value, java.lang.Object container)
canAddWithoutEvicting
in interface PoolAccessor
key
- the key of the elementvalue
- the value of the elementcontainer
- the element-container objectpublic long delete(long sizeOf)
delete
in interface PoolAccessor
sizeOf
- number of bytespublic long replace(long currentSize, java.lang.Object key, java.lang.Object value, java.lang.Object container, boolean force)
replace
in interface PoolAccessor
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 resourcespublic long getSize()
getSize
in interface PoolAccessor
public void unlink()
unlink
in interface PoolAccessor
public void clear()
clear
in interface PoolAccessor
public java.lang.Object getStore()
getStore
in interface PoolAccessor
public void setMaxSize(long newValue)
setMaxSize
in interface PoolAccessor
newValue
- the value in bytespublic boolean hasAbortedSizeOf()
hasAbortedSizeOf
in interface PoolAccessor