MediaWiki REL1_31
|
Readahead helper for making large MediaWiki data dumps; reads in a previous XML dump to sequentially prefetch text records already normalized and decompressed. More...
Public Member Functions | |
__construct ( $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') | |
Protected Attributes | |
$atEnd = false | |
$atPageEnd = false | |
$infiles = null | |
$lastPage = 0 | |
$lastRev = 0 | |
XMLReader | $reader = null |
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:
Definition at line 42 of file BaseDump.php.
BaseDump::__construct | ( | $infile | ) |
Definition at line 51 of file BaseDump.php.
BaseDump::close | ( | ) |
Definition at line 213 of file BaseDump.php.
Referenced by nextPage(), nodeContents(), and skipTo().
BaseDump::debug | ( | $str | ) |
Definition at line 101 of file BaseDump.php.
References wfDebug().
Referenced by prefetch(), and skipTo().
BaseDump::nextPage | ( | ) |
Definition at line 110 of file BaseDump.php.
References close(), nodeContents(), and skipTo().
Referenced by prefetch().
BaseDump::nextRev | ( | ) |
Definition at line 130 of file BaseDump.php.
References nodeContents(), and skipTo().
Referenced by prefetch().
BaseDump::nextText | ( | ) |
Definition at line 144 of file BaseDump.php.
References nodeContents(), and skipTo().
Referenced by prefetch().
BaseDump::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.
Definition at line 186 of file BaseDump.php.
References $buffer, and close().
Referenced by nextPage(), nextRev(), and nextText().
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.
int | $page | ID number of page to read |
int | $rev | ID number of revision to read |
Definition at line 71 of file BaseDump.php.
References $rev, debug(), nextPage(), nextRev(), and nextText().
BaseDump::skipTo | ( | $name, | |
$parent = 'page' ) |
string | $name | |
string | $parent |
Definition at line 156 of file BaseDump.php.
References close(), and debug().
Referenced by nextPage(), nextRev(), and nextText().
|
protected |
Definition at line 45 of file BaseDump.php.
|
protected |
Definition at line 46 of file BaseDump.php.
|
protected |
Definition at line 49 of file BaseDump.php.
|
protected |
Definition at line 47 of file BaseDump.php.
|
protected |
Definition at line 48 of file BaseDump.php.
|
protected |
Definition at line 44 of file BaseDump.php.