类 LfuCache

  • 所有已实现的接口:
    Cache

    public class LfuCache
    extends Object
    implements Cache
    This class store the cache value per thread. If a service,method,consumer or provided is configured with key cache with value lfu, dubbo initialize the instance of this class using LfuCacheFactory to store method's returns value to server from store without making method call.
         e.g. 1) <dubbo:service cache="lfu" cache.size="5000" cache.evictionFactor="0.3"/>
              2) <dubbo:consumer cache="lfu" />
     
     LfuCache uses url's cache.size value for its max store size, url's cache.evictionFactor value for its eviction factor,
     default store size value will be 1000, default eviction factor will be 0.3
     
    另请参阅:
    Cache, LfuCacheFactory, AbstractCacheFactory, CacheFilter
    • 构造器详细资料

      • LfuCache

        public LfuCache​(URL url)
        Initialize LfuCache, it uses constructor argument cache.size value as its storage max size. If nothing is provided then it will use 1000 as default size value. cache.evictionFactor value as its eviction factor. If nothing is provided then it will use 0.3 as default value.
        参数:
        url - A valid URL instance
    • 方法详细资料

      • put

        public void put​(Object key,
                        Object value)
        API to store value against a key in the calling thread scope.
        指定者:
        put 在接口中 Cache
        参数:
        key - Unique identifier for the object being store.
        value - Value getting store
      • get

        public Object get​(Object key)
        API to return stored value using a key against the calling thread specific store.
        指定者:
        get 在接口中 Cache
        参数:
        key - Unique identifier for cache lookup
        返回:
        Return stored object against key