Package com.gigaspaces.internal.io
Class SmartLengthBasedCache<T>
java.lang.Object
com.gigaspaces.internal.io.SmartLengthBasedCache<T>
- Direct Known Subclasses:
SmartByteArrayCache,SmartByteBufferCache
A smart length based caching based on soft reference
- Since:
- 9.6
- Author:
- eitany
-
Constructor Summary
ConstructorsConstructorDescriptionSmartLengthBasedCache(int maxCachedBufferLength, double expungeRatio, int expungeCount, int defaultResourceLength, ISmartLengthBasedCacheCallback callback) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TcreateResource(int length) get()get(int length) longprotected abstract intgetResourceCapacity(T resource) voidnotifyUsedSize(int usedSize) protected abstract voidprepareResource(T resource) protected abstract voidprepareResource(T resource, int length) voidtoCacheCallback(IMemoryAwareResourcePool resourcePool) protected voidtryCacheResource(T resource)
-
Constructor Details
-
SmartLengthBasedCache
public SmartLengthBasedCache(int maxCachedBufferLength, double expungeRatio, int expungeCount, int defaultResourceLength, ISmartLengthBasedCacheCallback callback)
-
-
Method Details
-
get
-
tryCacheResource
-
prepareResource
-
prepareResource
-
createResource
-
getResourceCapacity
-
getLength
public long getLength() -
get
-
set
-
notifyUsedSize
public void notifyUsedSize(int usedSize) -
toCacheCallback
-