Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | List of all members
SMW\Query\Result\CachedQueryResultPrefetcher Class Reference
Inheritance diagram for SMW\Query\Result\CachedQueryResultPrefetcher:
Inheritance graph
[legend]
Collaboration diagram for SMW\Query\Result\CachedQueryResultPrefetcher:
Collaboration graph
[legend]

Public Member Functions

 __construct (Store $store, QueryFactory $queryFactory, BlobStore $blobStore, BufferedStatsdCollector $bufferedStatsdCollector)
 
 getStats ()
 
 setDependantHashIdExtension ( $dependantHashIdExtension)
 
 setLogger (LoggerInterface $logger)
 
 setQueryEngine (QueryEngine $queryEngine)
 
 isEnabled ()
 
 disableCache ()
 
 recordStats ()
 
 setNonEmbeddedCacheLifetime ( $nonEmbeddedCacheLifetime)
 
 getQueryResult (Query $query)
 
 invalidate (array $queryList, $context='')
 
 resetCacheBy ( $items, $context='')
 

Public Attributes

const VERSION = '1'
 
const CACHE_NAMESPACE = 'smw:query:store'
 
const STATSD_ID = 'smw:query:store:1:d:'
 
const POOLCACHE_ID = 'queryresult.prefetcher'
 

Detailed Description

The prefetcher only caches the subject list from a computed a query condition. The result is processed before an individual query printer has access to the query result hence it does not interfere with the final string output manipulation.

The main objective is to avoid unnecessary computing of results for queries that have the same query signature. PrintRequests as part of a QueryResult object are not cached and are not part of a query signature.

Cache eviction is carried out either manually (action=purge) or executed through the QueryDepedencyLinksStore.

GNU GPL v2+

Since
2.5
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\Query\Result\CachedQueryResultPrefetcher::__construct ( Store  $store,
QueryFactory  $queryFactory,
BlobStore  $blobStore,
BufferedStatsdCollector  $bufferedStatsdCollector 
)
Since
2.5
Parameters
Store$store
QueryFactory$queryFactory
BlobStore$blobStore
BufferedStatsdCollector$bufferedStatsdCollector

Member Function Documentation

◆ disableCache()

SMW\Query\Result\CachedQueryResultPrefetcher::disableCache ( )
Since
2.5
Parameters
QueryEngine$queryEngine

◆ getQueryResult()

SMW\Query\Result\CachedQueryResultPrefetcher::getQueryResult ( Query  $query)
See also
QueryEngine::getQueryResult
Since
2.5

Returns a QueryResult object that matches the condition described by a query.

Note
If the request was made for a debug (querymode MODE_DEBUG) query then a simple HTML-compatible string is returned.
Since
2.5
Parameters
Query$query
Returns
QueryResult|string

Implements SMW\QueryEngine.

◆ getStats()

SMW\Query\Result\CachedQueryResultPrefetcher::getStats ( )
Since
2.5
Returns
array

◆ invalidate()

SMW\Query\Result\CachedQueryResultPrefetcher::invalidate ( array  $queryList,
  $context = '' 
)
Since
3.1
Parameters
array$ids
string$context

◆ isEnabled()

SMW\Query\Result\CachedQueryResultPrefetcher::isEnabled ( )
Since
2.5
Parameters
boolean

◆ recordStats()

SMW\Query\Result\CachedQueryResultPrefetcher::recordStats ( )
Since
2.5

◆ resetCacheBy()

SMW\Query\Result\CachedQueryResultPrefetcher::resetCacheBy (   $items,
  $context = '' 
)
Since
2.5
Parameters
DIWikiPage | array$items
string$context

◆ setDependantHashIdExtension()

SMW\Query\Result\CachedQueryResultPrefetcher::setDependantHashIdExtension (   $dependantHashIdExtension)
Since
2.5
Parameters
string | integer$dependantHashIdExtension

◆ setLogger()

SMW\Query\Result\CachedQueryResultPrefetcher::setLogger ( LoggerInterface  $logger)
See also
LoggerAwareInterface::setLogger
Since
2.5
Parameters
LoggerInterface$logger

◆ setNonEmbeddedCacheLifetime()

SMW\Query\Result\CachedQueryResultPrefetcher::setNonEmbeddedCacheLifetime (   $nonEmbeddedCacheLifetime)
Since
2.5
Parameters
integer | boolean$nonEmbeddedCacheLifetime

◆ setQueryEngine()

SMW\Query\Result\CachedQueryResultPrefetcher::setQueryEngine ( QueryEngine  $queryEngine)
Since
2.5
Parameters
QueryEngine$queryEngine

Member Data Documentation

◆ CACHE_NAMESPACE

const SMW\Query\Result\CachedQueryResultPrefetcher::CACHE_NAMESPACE = 'smw:query:store'

Namespace occupied by the BlobStore

◆ POOLCACHE_ID

const SMW\Query\Result\CachedQueryResultPrefetcher::POOLCACHE_ID = 'queryresult.prefetcher'

ID for the tempCache

◆ STATSD_ID

const SMW\Query\Result\CachedQueryResultPrefetcher::STATSD_ID = 'smw:query:store:1:d:'

ID used by the bufferedStatsdCollector, requires to be changed in case the data schema is modified

PHP 5.6 can do self::CACHE_NAMESPACE . ':' . self::VERSION

◆ VERSION

const SMW\Query\Result\CachedQueryResultPrefetcher::VERSION = '1'

Update this version number when the serialization format changes.


The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy