Class WriteLockedOffHeapClockCache<K,​V>

  • Type Parameters:
    K - the type of keys maintained by this map
    V - the type of mapped values
    All Implemented Interfaces:
    java.util.concurrent.ConcurrentMap<K,​V>, java.util.concurrent.locks.ReadWriteLock, java.util.Map<K,​V>, HashingMap<K,​V>, MapInternals, PinnableCache<K,​V>, PinnableSegment<K,​V>, Segment<K,​V>, StorageEngine.Owner
    Direct Known Subclasses:
    EvictionListeningWriteLockedOffHeapClockCache

    public class WriteLockedOffHeapClockCache<K,​V>
    extends AbstractOffHeapClockCache<K,​V>
    An exclusive-read/write off-heap clock cache.

    This cache uses one of the unused bits in the off-heap entry's status value to store the clock data. This clock data is safe to update during read operations since the cache provides exclusive-read/write characteristics. Since clock eviction data resides in the hash-map's table, it is correctly copied across during table resize operations.

    The cache uses a regular ReentrantLock to provide exclusive read and write operations.

    • Field Detail

      • lock

        private final java.util.concurrent.locks.Lock lock
    • Constructor Detail

      • WriteLockedOffHeapClockCache

        public WriteLockedOffHeapClockCache​(PageSource source,
                                            StorageEngine<? super K,​? super V> storageEngine)
      • WriteLockedOffHeapClockCache

        public WriteLockedOffHeapClockCache​(PageSource source,
                                            boolean tableAllocationsSteal,
                                            StorageEngine<? super K,​? super V> storageEngine)
      • WriteLockedOffHeapClockCache

        public WriteLockedOffHeapClockCache​(PageSource source,
                                            StorageEngine<? super K,​? super V> storageEngine,
                                            int tableSize)
      • WriteLockedOffHeapClockCache

        public WriteLockedOffHeapClockCache​(PageSource source,
                                            boolean tableAllocationsSteal,
                                            StorageEngine<? super K,​? super V> storageEngine,
                                            int tableSize)
    • Method Detail

      • readLock

        public java.util.concurrent.locks.Lock readLock()
        Specified by:
        readLock in interface java.util.concurrent.locks.ReadWriteLock
        Specified by:
        readLock in class AbstractLockedOffHeapHashMap<K,​V>
      • writeLock

        public java.util.concurrent.locks.Lock writeLock()
        Specified by:
        writeLock in interface java.util.concurrent.locks.ReadWriteLock
        Specified by:
        writeLock in class AbstractLockedOffHeapHashMap<K,​V>
      • getLock

        public java.util.concurrent.locks.ReentrantReadWriteLock getLock()
        Description copied from interface: Segment
        Return the ReentrantReadWriteLock used by this segment.
        Returns:
        RRWL for this segment