![]() |
JODA
0.13.1 (59b41972)
JSON On-Demand Analysis
|
#include <QueryCache.h>
Public Member Functions | |
| std::shared_ptr< const CacheEntry::CacheIndex > | getBestCache (const std::shared_ptr< joda::query::Predicate > &pred) |
| std::shared_ptr< const CacheEntry::CacheIndex > | getBestCache (const std::unique_ptr< joda::query::Predicate > &pred) |
| std::shared_ptr< const CacheEntry::CacheIndex > | getBestCache (const std::string &predStr) |
| bool | cacheAvailable (const std::shared_ptr< joda::query::Predicate > &pred) |
| bool | cacheAvailable (const std::string &predStr) |
| void | addQueryResult (std::unique_ptr< CacheEntry > &&ce) |
| void | addQueryResult (std::shared_ptr< const CacheEntry::CacheIndex > docs, const std::shared_ptr< joda::query::Predicate > &predicate) |
| void | reset () |
Protected Attributes | |
| std::unordered_map< std::string, std::unique_ptr< CacheEntry > > | queryMap |
This class is responsible for managing a cache for previously exectuted queries.
| void QueryCache::addQueryResult | ( | std::shared_ptr< const CacheEntry::CacheIndex > | docs, |
| const std::shared_ptr< joda::query::Predicate > & | predicate | ||
| ) |
Creates and adds an CacheEntry to the QueryCache
| docs | The set of DOC_IDs to add to the CacheEntry |
| predicate | The predicate that produced docs |
| void QueryCache::addQueryResult | ( | std::unique_ptr< CacheEntry > && | ce | ) |
Adds an already created CacheEntry
| ce | CacheEntry to insert to the QueryCache |
| bool QueryCache::cacheAvailable | ( | const std::shared_ptr< joda::query::Predicate > & | pred | ) |
Checks if the given predicate is stored in the cache
| pred | Predicate to check for |
| bool QueryCache::cacheAvailable | ( | const std::string & | predStr | ) |
Checks if the given predicate is stored in the cache
| predStr | Predicate to check for |
| std::shared_ptr< const CacheEntry::CacheIndex > QueryCache::getBestCache | ( | const std::shared_ptr< joda::query::Predicate > & | pred | ) |
Returns the cached DOC_IDs for the given predicate
| pred | The predicated in internal representation |
| std::shared_ptr< const CacheEntry::CacheIndex > QueryCache::getBestCache | ( | const std::string & | predStr | ) |
Returns the cached DOC_IDs for the given predicate
| predStr | The predicated in string representation |
| std::shared_ptr< const CacheEntry::CacheIndex > QueryCache::getBestCache | ( | const std::unique_ptr< joda::query::Predicate > & | pred | ) |
Returns the cached DOC_IDs for the given predicate
| pred | The predicated in internal representation |
| void QueryCache::reset | ( | ) |
Resets the QueryCache and removes all CacheEntries
|
protected |