类 LFUCache<K,V>
- java.lang.Object
-
- org.apache.dubbo.common.utils.LFUCache<K,V>
-
public class LFUCache<K,V> extends Object
-
-
构造器概要
构造器 构造器 说明 LFUCache()LFUCache(int maxCapacity, float evictionFactor)Constructs and initializes cache with specified capacity and eviction factor.LFUCache(int maxCapacity, float evictionFactor, long removeFreqEntryTimeout)Constructs and initializes cache with specified capacity and eviction factor.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Vget(K key)intgetCapacity()LonggetFreq(K key)Returns freq of the elementintgetFreqListSize(Long freq)Returns node list's size of this frequencyintgetFreqTableSize()Returns size of the freq tableintgetSize()Returns cache current size.Vput(K key, V value)Vremove(K key)
-
-
-
构造器详细资料
-
LFUCache
public LFUCache()
-
LFUCache
public LFUCache(int maxCapacity, float evictionFactor)Constructs and initializes cache with specified capacity and eviction factor. Unacceptable parameter values followed withIllegalArgumentException.- 参数:
maxCapacity- cache max capacityevictionFactor- cache proceedEviction factor
-
LFUCache
public LFUCache(int maxCapacity, float evictionFactor, long removeFreqEntryTimeout)Constructs and initializes cache with specified capacity and eviction factor. Unacceptable parameter values followed withIllegalArgumentException.- 参数:
maxCapacity- cache max capacityevictionFactor- cache proceedEviction factorremoveFreqEntryTimeout- cache queue remove timeout
-
-
方法详细资料
-
getCapacity
public int getCapacity()
-
getFreqTableSize
public int getFreqTableSize()
Returns size of the freq table- 返回:
- size
-
getFreqListSize
public int getFreqListSize(Long freq)
Returns node list's size of this frequency- 返回:
- node list's size
-
getSize
public int getSize()
Returns cache current size.- 返回:
- cache size
-
-