Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
CDBMessageIndex Class Reference

Storage on CDB files. More...

Inheritance diagram for CDBMessageIndex:
MessageIndex

Public Member Functions

 retrieve (bool $readLatest=false)
 
 getKeys ()
 
- Public Member Functions inherited from MessageIndex
 rebuild (float $timestamp=null)
 Creates the index from scratch.
 
 getStatusCacheKey ()
 
 storeInterim (MessageGroup $group, array $newKeys)
 

Protected Member Functions

 get ( $key)
 Looks up the stored value for single key.
 
 store (array $array, array $diff)
 
 getReader ()
 
- Protected Member Functions inherited from MessageIndex
 lock ()
 
 unlock ()
 
 clearMessageGroupStats (array $diff)
 Purge stuff when set of keys have changed.
 
 checkAndAdd (&$hugearray, MessageGroup $g, $ignore=false)
 
 serialize ( $data)
 These are probably slower than serialize and unserialize, but they are more space efficient because we only need strings and arrays.
 
 unserialize ( $data)
 

Protected Attributes

 $index
 
 $reader
 
 $filename = 'translate_messageindex.cdb'
 
- Protected Attributes inherited from MessageIndex
 $interimCache
 

Additional Inherited Members

- Static Public Member Functions inherited from MessageIndex
static singleton ()
 
static setInstance (self $instance)
 Override the global instance, for testing.
 
static getGroupIds (MessageHandle $handle)
 Retrieves a list of groups given MessageHandle belongs to.
 
static getPrimaryGroupId (MessageHandle $handle)
 
static getArrayDiff (array $old, array $new)
 Compares two associative arrays.
 
- Static Protected Attributes inherited from MessageIndex
static $instance
 

Detailed Description

Storage on CDB files.

This is improved version of SerializedMessageIndex. It uses CDB files for storage, which means it provides random access. The CDB files are about double the size of serialized files (~7M for 50000 keys).

Loading the whole index is slower than serialized, but about the same as for database. Suitable for single-server setups where SerializedMessageIndex is too slow for loading the whole index.

Since
2012-04-10

Definition at line 650 of file MessageIndex.php.

Member Function Documentation

◆ get()

CDBMessageIndex::get ( $key)
protected

Looks up the stored value for single key.

Only for testing.

Since
2012-04-10
Parameters
string$key
Returns
string|array|null

Reimplemented from MessageIndex.

Definition at line 689 of file MessageIndex.php.

◆ getKeys()

CDBMessageIndex::getKeys ( )
Since
2018.01
Returns
string[]

Reimplemented from MessageIndex.

Definition at line 677 of file MessageIndex.php.

◆ getReader()

CDBMessageIndex::getReader ( )
protected

Definition at line 716 of file MessageIndex.php.

◆ retrieve()

CDBMessageIndex::retrieve ( bool $readLatest = false)
Parameters
bool$readLatest
Returns
array

Reimplemented from MessageIndex.

Definition at line 662 of file MessageIndex.php.

◆ store()

CDBMessageIndex::store ( array $array,
array $diff )
protected

Reimplemented from MessageIndex.

Definition at line 700 of file MessageIndex.php.

Member Data Documentation

◆ $filename

CDBMessageIndex::$filename = 'translate_messageindex.cdb'
protected

Definition at line 656 of file MessageIndex.php.

◆ $index

CDBMessageIndex::$index
protected

Definition at line 652 of file MessageIndex.php.

◆ $reader

CDBMessageIndex::$reader
protected

Definition at line 654 of file MessageIndex.php.


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