java.lang.Object
com.hazelcast.hibernate.distributed.IMapRegionCache
- All Implemented Interfaces:
RegionCache,org.hibernate.cache.spi.ExtendedStatisticsSupport,org.hibernate.cache.spi.Region
A
RegionCache implementation based on the underlying IMap
Note, IMap locks are intentionally not used in this class. Hibernate region caches make use of a concept
called soft-locking which has the following properties:
- Multiple transactions can soft-lock an entry concurrently
- While an entry is soft-locked, the value of the cache entry is always
null - An entry is unlocked from a soft-lock when all transactions complete
- An entry is unlocked if it reaches the configured lock timeout
-
Constructor Summary
ConstructorsConstructorDescriptionIMapRegionCache(org.hibernate.cache.spi.RegionFactory regionFactory, String name, com.hazelcast.core.HazelcastInstance hazelcastInstance) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterUpdate(Object key, Object newValue, Object newVersion) booleanvoidvoidlongReturns the number of in-memory entries (without backups) for a particular application instance or -1 if using Hazelcast ClientgetName()org.hibernate.cache.spi.RegionFactorylongReturns the total in-memory cost in bytes (including IMap, Near Cache, backup, Merkle trees) for a particular application instance or -1 if using Hazelcast ClientbooleanvoidunlockItem(Object key, org.hibernate.cache.spi.access.SoftLock lock) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hazelcast.hibernate.RegionCache
clear, destroy, getElementCountOnDisk, nextTimestamp
-
Constructor Details
-
IMapRegionCache
public IMapRegionCache(org.hibernate.cache.spi.RegionFactory regionFactory, String name, com.hazelcast.core.HazelcastInstance hazelcastInstance)
-
-
Method Details
-
afterUpdate
- Specified by:
afterUpdatein interfaceRegionCache
-
contains
- Specified by:
containsin interfaceRegionCache
-
evictData
public void evictData()- Specified by:
evictDatain interfaceRegionCache
-
evictData
- Specified by:
evictDatain interfaceRegionCache
-
get
- Specified by:
getin interfaceRegionCache
-
getElementCountInMemory
public long getElementCountInMemory()Returns the number of in-memory entries (without backups) for a particular application instance or -1 if using Hazelcast Client- Specified by:
getElementCountInMemoryin interfaceorg.hibernate.cache.spi.ExtendedStatisticsSupport
-
getName
- Specified by:
getNamein interfaceorg.hibernate.cache.spi.Region
-
getRegionFactory
public org.hibernate.cache.spi.RegionFactory getRegionFactory()- Specified by:
getRegionFactoryin interfaceorg.hibernate.cache.spi.Region
-
getSizeInMemory
public long getSizeInMemory()Returns the total in-memory cost in bytes (including IMap, Near Cache, backup, Merkle trees) for a particular application instance or -1 if using Hazelcast Client- Specified by:
getSizeInMemoryin interfaceorg.hibernate.cache.spi.ExtendedStatisticsSupport
-
put
- Specified by:
putin interfaceRegionCache
-
unlockItem
- Specified by:
unlockItemin interfaceRegionCache
-