MediaWiki  REL1_19
BaseDump Class Reference

Readahead helper for making large MediaWiki data dumps; reads in a previous XML dump to sequentially prefetch text records already normalized and decompressed. More...

List of all members.

Public Member Functions

 BaseDump ($infile)
 close ()
 debug ($str)
 nextPage ()
 nextRev ()
 nextText ()
 nodeContents ()
 Shouldn't something like this be built-in to XMLReader? Fetches text contents of the current element, assuming no sub-elements or such scary things.
 prefetch ($page, $rev)
 Attempts to fetch the text of a particular page revision from the dump stream.
 skipTo ($name, $parent= 'page')

Public Attributes

 $atEnd = false
 $atPageEnd = false
 $infiles = null
 $lastPage = 0
 $lastRev = 0
 $reader = null

Detailed Description

Readahead helper for making large MediaWiki data dumps; reads in a previous XML dump to sequentially prefetch text records already normalized and decompressed.

This can save load on the external database servers, hopefully.

Assumes that dumps will be recorded in the canonical order:

  • ascending by page_id
  • ascending by rev_id within each page
  • text contents are immutable and should not change once recorded, so the previous dump is a reliable source

Definition at line 42 of file backupPrefetch.inc.


Member Function Documentation

BaseDump::BaseDump ( infile)

Definition at line 50 of file backupPrefetch.inc.

Access:
private
Returns:
null

Definition at line 201 of file backupPrefetch.inc.

Referenced by nextPage(), nodeContents(), and skipTo().

Here is the caller graph for this function:

BaseDump::debug ( str)

Definition at line 95 of file backupPrefetch.inc.

References wfDebug().

Referenced by prefetch(), and skipTo().

Here is the call graph for this function:

Here is the caller graph for this function:

Access:
private

Definition at line 104 of file backupPrefetch.inc.

References close(), nodeContents(), and skipTo().

Referenced by prefetch().

Here is the call graph for this function:

Here is the caller graph for this function:

Access:
private

Definition at line 124 of file backupPrefetch.inc.

References nodeContents(), and skipTo().

Referenced by prefetch().

Here is the call graph for this function:

Here is the caller graph for this function:

Access:
private
Returns:
string

Definition at line 138 of file backupPrefetch.inc.

References nodeContents(), and skipTo().

Referenced by prefetch().

Here is the call graph for this function:

Here is the caller graph for this function:

Shouldn't something like this be built-in to XMLReader? Fetches text contents of the current element, assuming no sub-elements or such scary things.

Returns:
String
Access:
private

Definition at line 175 of file backupPrefetch.inc.

References close().

Referenced by nextPage(), nextRev(), and nextText().

Here is the call graph for this function:

Here is the caller graph for this function:

BaseDump::prefetch ( page,
rev 
)

Attempts to fetch the text of a particular page revision from the dump stream.

May return null if the page is unavailable.

Parameters:
$pageInteger: ID number of page to read
$revInteger: ID number of revision to read
Returns:
string or null

Definition at line 71 of file backupPrefetch.inc.

References $page, debug(), nextPage(), nextRev(), and nextText().

Here is the call graph for this function:

BaseDump::skipTo ( name,
parent = 'page' 
)
Access:
private
Parameters:
$namestring
$parentstring
Returns:
bool|null

Definition at line 149 of file backupPrefetch.inc.

References close(), and debug().

Referenced by nextPage(), nextRev(), and nextText().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

BaseDump::$atEnd = false

Definition at line 44 of file backupPrefetch.inc.

BaseDump::$atPageEnd = false

Definition at line 45 of file backupPrefetch.inc.

BaseDump::$infiles = null

Definition at line 48 of file backupPrefetch.inc.

BaseDump::$lastPage = 0

Definition at line 46 of file backupPrefetch.inc.

BaseDump::$lastRev = 0

Definition at line 47 of file backupPrefetch.inc.

BaseDump::$reader = null

Definition at line 43 of file backupPrefetch.inc.


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