Class AbstractOffHeapClockCache<K,​V>

    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • rndm

        private final java.util.Random rndm
      • clockHand

        private int clockHand
    • Constructor Detail

      • AbstractOffHeapClockCache

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

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

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

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

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

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

      • hit

        protected void hit​(int position,
                           java.nio.IntBuffer entry)
        Overrides:
        hit in class OffHeapHashMap<K,​V>
      • getEvictionIndex

        public int getEvictionIndex()
        Return the table offset of the to be evicted mapping.

        The mapping to be evicted can occur anywhere in this cache's table.

        Returns:
        table offset of the mapping to be evicted
      • getEvictionIndex

        private int getEvictionIndex​(int start,
                                     int length)
        Return the table offset of the to be evicted mapping within the given probe sequence.

        The mapping to be evicted must occur within the given probe sequence.

        Parameters:
        start - initial slot in probe sequence
        length - number of slots in probe sequence
        Returns:
        table offset of the mapping to be evicted
      • evictable

        protected boolean evictable​(int status)
      • isPinned

        public boolean isPinned​(java.lang.Object key)
        Specified by:
        isPinned in interface PinnableCache<K,​V>