Ok, I will fix it soon.



------------------ ???????? ------------------
??????:                                                                         
                                               "dev"                            
                                                        <[email protected]&gt;;
????????:&nbsp;2021??5??17??(??????) ????4:50
??????:&nbsp;"dev"<[email protected]&gt;;

????:&nbsp;Re: There may be a wrong way to use guava cache



Hi,

I checked the API for Guava , You are right , this is a bug,&nbsp;&nbsp; Can 
you fix
it.?



ttttangzhen <[email protected]&gt; ??2021??5??17?????? ????4:47??????

&gt; maximumWeight(maxCount)&nbsp; mean max total weight,
&gt; but the method getSize return weight may cause that when the number of
&gt; caches increases to 316, adding a new cache will delete many caches
&gt; I think maximumSize should be used here instead of maximumWeight.
&gt;
&gt; if you think so, I will fix it
&gt;
&gt;
&gt; ------------------ ???????? ------------------??????:
&gt;
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 "dev"
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <[email protected]&gt;;????????: 2021??5??17??(??????)
&gt; ????3:52??????: "dev"<[email protected]&gt;;????: Re: There may be a 
wrong way
&gt; to use guava cacheHi ??maxCount is capacity of guava cache??others
&gt; thinks??ttttangzhen <[email protected]&gt; ??2021??5??17?????? 
????3:48??????&gt; in
&gt; org.apache.shenyu.plugin.apache.dubbo.cache.ApplicationConfigCache and&gt;
&gt; ApplicationConfigCache in other RPC plugin&gt;&gt;
&gt; 
------------------------------------------------------------------------------------------------&gt;
&gt; private final LoadingCache<&gt; cache = CacheBuilder.newBuilder()&gt;&gt;
&gt; .maximumWeight(maxCount)&gt;&gt; .weigher( (string, referenceConfig) -&gt;
&gt; getSize())&gt;&gt; .build();&gt;&gt; private int getSize() {&gt; return 
(int)
&gt; cache.size();&gt; }&gt;&gt;
&gt; 
------------------------------------------------------------------------------------------------&gt;&gt;
&gt; Here, weight is used to control the total capacity of guava cache, but 
the&gt;
&gt; weight of each cache use getSize,it represents the total number of 
items&gt;
&gt; cached when a piece of data is cached.&gt; I think there may be wrong usage
&gt; here, If we use weights, the weights&gt; should represent the size of each
&gt; piece of data, so here should be replaced&gt; by the number of bars to 
control
&gt; the total capacity

Reply via email to