| Modifier and Type | Field and Description |
|---|---|
| protected volatile int | cleanupCount
Keep track of a counter to amortize cleanup of dead cache keys |
| protected volatile int | cleanupSize
PERF: Keep track of a cleanup size to avoid cleanup bottleneck for large caches. |
| protected ReferenceQueue |
| Access | Constructor and Description |
|---|---|
| public | WeakUnitOfWorkIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated)
|
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | |
| public CacheKey | createCacheKey(Object primaryKey, Object object, Object writeLockValue, long readTime)
Overrides org. |
| protected CacheKey | putCacheKeyIfAbsent(CacheKey searchKey)
Overrides org. |
| cleanupCount | back to summary |
|---|---|
| protected volatile int cleanupCount Keep track of a counter to amortize cleanup of dead cache keys | |
| cleanupSize | back to summary |
|---|---|
| protected volatile int cleanupSize PERF: Keep track of a cleanup size to avoid cleanup bottleneck for large caches. | |
| referenceQueue | back to summary |
|---|---|
| protected ReferenceQueue<T> referenceQueue | |
| WeakUnitOfWorkIdentityMap | back to summary |
|---|---|
| public WeakUnitOfWorkIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated) | |
| checkCleanup | back to summary |
|---|---|
| protected void checkCleanup() Check if garbage collected cache keys need to be cleaned up. | |
| cleanupDeadCacheKeys | back to summary |
|---|---|
| protected void cleanupDeadCacheKeys() Search for any cache keys that have been garbage collected and remove them. This must be done because although the objects held by the cache keys will garbage collect, the keys themselves will not and must be cleaned up. This is a linear operation so is amortized through the cleanupCount to occur only once per cycle averaging to make the total time still constant. | |
| createCacheKey | back to summary |
|---|---|
| public CacheKey createCacheKey(Object primaryKey, Object object, Object writeLockValue, long readTime) Overrides org. Doc from org. Create the correct type of CacheKey for this map.
| |
| putCacheKeyIfAbsent | back to summary |
|---|---|
| protected CacheKey putCacheKeyIfAbsent(CacheKey searchKey) Overrides org. Need to check for cleanup on put.
| |