hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benoy Antony (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HADOOP-11402) Use guava cache to implement negative user-to-group cache
Date Fri, 26 Dec 2014 18:11:13 GMT

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

Benoy Antony edited comment on HADOOP-11402 at 12/26/14 6:11 PM:
-----------------------------------------------------------------

Since the negativeCacheTimeout is already specified while building the cache, there is no
benefit in storing expirationTime in each cache entry.
Instead, is it possible to keep it as a Set ?

An untested code snippet is below
 {code}
                  Set<String> negativeCache;
		 Cache<String, Boolean> tempNegativeCache = CacheBuilder.newBuilder()
				         .expireAfterWrite(negativeCacheTimeout, TimeUnit.MILLISECONDS)
				         .ticker(new TimerToTickerAdapter(timer))
				         .build();
		 negativeCache = Collections.newSetFromMap(tempNegativeCache.asMap());
{code}


was (Author: benoyantony):
Since the negativeCacheTimeout is already specified while building the cache, there is no
benefit in storing expirationTime in each cache entry.
Instead, is it possible to keep it as a Set ?

An untested code snippet is below
 {code}
                  Set<String> negativeCache;
		 Cache<String, Boolean> negativeCacheMap = CacheBuilder.newBuilder()
				         .expireAfterWrite(negativeCacheTimeout, TimeUnit.MILLISECONDS)
				         .ticker(new TimerToTickerAdapter(timer))
				         .build();
		 negativeCache = Collections.newSetFromMap(negativeCache.asMap());
{code}

> Use guava cache to implement negative user-to-group cache
> ---------------------------------------------------------
>
>                 Key: HADOOP-11402
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11402
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 2.6.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Varun Saxena
>         Attachments: HADOOP-11402.001.patch, HADOOP-11402.002.patch
>
>
> Negative user-to-group cache entries are never cleared for never-again-accessed users.
 Use guava cache so that expired entries can be deleted automatically



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message