[ 
https://issues.apache.org/jira/browse/HDFS-5256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13802619#comment-13802619
 ] 

Haohui Mai commented on HDFS-5256:
----------------------------------

bq. How does testEviction test eviction? It sets a max cache size of 2 and only 
ever caches one entry?

The guava cache only holds MAX_CACHE_SIZE - 1 entries, therefore the unit test 
is a basic test whether the eviction works.

The unit test is basically a rewrite of the legacy unit test. We used to 
implement the cache in house, but
given the fact that DFSClientCache is a thin wrap of guava cache, the test 
looks more like a unit test of the guava cache rather than a test of 
DFSClientCache.

bq. Nit: clientCache is overloaded as both an integer and a LoadingCache object 
in the constructor

Testing is the only reason of implementing two constructors of 
DFSClientCache(). It should be cleaned up once we reach a consensus on the unit 
test.

bq. Nit: Spelling mistake in "clientRemovealListener"

I'll fix it in a separate jira.



> Use guava LoadingCache to implement DFSClientCache
> --------------------------------------------------
>
>                 Key: HDFS-5256
>                 URL: https://issues.apache.org/jira/browse/HDFS-5256
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: nfs
>            Reporter: Haohui Mai
>            Assignee: Haohui Mai
>             Fix For: 2.2.0
>
>         Attachments: HDFS-5256.000.patch, HDFS-5256.001.patch, 
> HDFS-5256.002.patch, HDFS-5256.003.patch, HDFS-5256.004.patch
>
>
> Google Guava provides an implementation of LoadingCache. Use the LoadingCache 
> to implement DFSClientCache in NFS. 



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to