org.apache.blur.manager
Class BlurFilterCache

java.lang.Object
  extended by org.apache.blur.manager.BlurFilterCache
Direct Known Subclasses:
AliasBlurFilterCache, DefaultBlurFilterCache

public abstract class BlurFilterCache
extends Object

The BlurFilterCache class provides the ability to cache pre and post filters on a per table basis. The closing and opening methods should be used as hooks to for when tables are being enabled and disabled.


Nested Class Summary
static interface BlurFilterCache.FilterParser
           
 
Constructor Summary
BlurFilterCache(BlurConfiguration configuration)
           
 
Method Summary
abstract  void closing(String table, String shard, BlurIndex index)
          Notifies the cache that the index is closing on this shard server.
abstract  org.apache.lucene.search.Filter fetchPostFilter(String table, String filterStr)
          The fetchPostFilter method fetches the cache post-filter (or Row Filter) before attempting to execute the filter provided by the user.
abstract  org.apache.lucene.search.Filter fetchPreFilter(String table, String filterStr)
          The fetchPreFilter method fetches the cache pre-filter (or Record Filter) before attempting to execute the filter provided by the user.
abstract  void opening(String table, String shard, BlurIndex index)
          Notifies the cache that the index is opening on this shard server.
abstract  org.apache.lucene.search.Filter storePostFilter(String table, String filterStr, org.apache.lucene.search.Filter filter, BlurFilterCache.FilterParser filterParser)
          The storePreFilter method stores the parsed post Filter (or Row Filter) for caching, and should return the Filter to be executed.
abstract  org.apache.lucene.search.Filter storePreFilter(String table, String filterStr, org.apache.lucene.search.Filter filter, BlurFilterCache.FilterParser filterParser)
          The storePreFilter method stores the parsed pre Filter (or Record Filter) for caching, and should return the Filter to be executed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlurFilterCache

public BlurFilterCache(BlurConfiguration configuration)
Method Detail

fetchPreFilter

public abstract org.apache.lucene.search.Filter fetchPreFilter(String table,
                                                               String filterStr)
The fetchPreFilter method fetches the cache pre-filter (or Record Filter) before attempting to execute the filter provided by the user.

Parameters:
table - the table name.
filterStr - the filter query string, should be used as a key.
Returns:
the Filter to execute or not is missing.

fetchPostFilter

public abstract org.apache.lucene.search.Filter fetchPostFilter(String table,
                                                                String filterStr)
The fetchPostFilter method fetches the cache post-filter (or Row Filter) before attempting to execute the filter provided by the user.

Parameters:
table - the table name.
filterStr - the filter query string, should be used as a key.
Returns:
the Filter to execute or not is missing.

storePreFilter

public abstract org.apache.lucene.search.Filter storePreFilter(String table,
                                                               String filterStr,
                                                               org.apache.lucene.search.Filter filter,
                                                               BlurFilterCache.FilterParser filterParser)
                                                        throws org.apache.lucene.queryparser.classic.ParseException
The storePreFilter method stores the parsed pre Filter (or Record Filter) for caching, and should return the Filter to be executed.

Parameters:
table - the table name.
filterStr - the filter query string, should be used as a key.
Returns:
the Filter that was parsed by the SuperParser.
Throws:
org.apache.lucene.queryparser.classic.ParseException

storePostFilter

public abstract org.apache.lucene.search.Filter storePostFilter(String table,
                                                                String filterStr,
                                                                org.apache.lucene.search.Filter filter,
                                                                BlurFilterCache.FilterParser filterParser)
                                                         throws org.apache.lucene.queryparser.classic.ParseException
The storePreFilter method stores the parsed post Filter (or Row Filter) for caching, and should return the Filter to be executed.

Parameters:
table - the table name.
filterStr - the filter query string, should be used as a key.
Returns:
the Filter that was parsed by the SuperParser.
Throws:
org.apache.lucene.queryparser.classic.ParseException

closing

public abstract void closing(String table,
                             String shard,
                             BlurIndex index)
Notifies the cache that the index is closing on this shard server.

Parameters:
table - the table name.
shard - the shard name.
index - the BlurIndex.

opening

public abstract void opening(String table,
                             String shard,
                             BlurIndex index)
Notifies the cache that the index is opening on this shard server.

Parameters:
table - the table name.
shard - the shard name.
index - the BlurIndex.


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