org.apache.blur.utils
Class QueryCache

java.lang.Object
  extended by org.apache.blur.utils.QueryCache
All Implemented Interfaces:
com.googlecode.concurrentlinkedhashmap.EvictionListener<QueryCacheKey,QueryCacheEntry>

public class QueryCache
extends Object
implements com.googlecode.concurrentlinkedhashmap.EvictionListener<QueryCacheKey,QueryCacheEntry>


Constructor Summary
QueryCache(String name, int cachedElements, long ttl)
           
 
Method Summary
 BlurResults cache(String table, BlurQuery original, BlurResults results)
           
 QueryCacheEntry get(QueryCacheKey key)
           
static QueryCacheKey getNormalizedBlurQueryKey(String table, BlurQuery blurQuery)
           
 boolean isValid(QueryCacheEntry entry)
           
 boolean isValid(QueryCacheEntry entry, SortedSet<String> currentShards)
           
 void onEviction(QueryCacheKey key, QueryCacheEntry value)
           
 void put(QueryCacheKey key, QueryCacheEntry value)
           
 void remove(QueryCacheKey key)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryCache

public QueryCache(String name,
                  int cachedElements,
                  long ttl)
Method Detail

onEviction

public void onEviction(QueryCacheKey key,
                       QueryCacheEntry value)
Specified by:
onEviction in interface com.googlecode.concurrentlinkedhashmap.EvictionListener<QueryCacheKey,QueryCacheEntry>

getNormalizedBlurQueryKey

public static QueryCacheKey getNormalizedBlurQueryKey(String table,
                                                      BlurQuery blurQuery)

isValid

public boolean isValid(QueryCacheEntry entry,
                       SortedSet<String> currentShards)

isValid

public boolean isValid(QueryCacheEntry entry)

cache

public BlurResults cache(String table,
                         BlurQuery original,
                         BlurResults results)

put

public void put(QueryCacheKey key,
                QueryCacheEntry value)

get

public QueryCacheEntry get(QueryCacheKey key)

remove

public void remove(QueryCacheKey key)


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.