Wikibase
MediaWiki Wikibase extension
|
DumpGenerator generates a dump of a given set of entities, excluding redirects. More...
Public Member Functions | |
__construct ( $out, EntityPrefetcher $entityPrefetcher) | |
setLimit ( $limit) | |
Set maximum number of entities produced. | |
setBatchSize ( $batchSize) | |
Sets the batch size for processing. | |
setProgressReporter (MessageReporter $progressReporter) | |
setExceptionHandler (ExceptionHandler $exceptionHandler) | |
setShardingFilter ( $shardingFactor, $shard) | |
Set the sharding factor and desired shard. | |
setEntityTypesFilter ( $types) | |
Set the entity types to be included in the output. | |
generateDump (EntityIdPager $idPager) | |
Generates a dump, writing to the file handle provided to the constructor. | |
Protected Member Functions | |
writeToDump ( $data) | |
Writers the given string to the output provided to the constructor. | |
preDump () | |
Do something before dumping data. | |
postDump () | |
Do something after dumping data. | |
preBatchDump ( $entities) | |
Do something before dumping a batch of entities. | |
preEntityDump ( $dumpCount) | |
Do something before dumping entity. | |
postEntityDump ( $dumpCount) | |
Do something after dumping entity. | |
generateDumpForEntityId (EntityId $entityId) | |
Produce dump data for specific entity. | |
Protected Attributes | |
$batchSize = 100 | |
$out | |
$shardingFactor = 1 | |
$shard = 0 | |
$progressReporter | |
$exceptionHandler | |
$entityPrefetcher | |
$entityTypes | |
$limit = 0 | |
Private Member Functions | |
idMatchesFilters (EntityId $entityId) | |
idMatchesShard (EntityId $entityId) | |
idMatchesType (EntityId $entityId) | |
dumpEntities (array $entityIds, &$dumpCount) | |
Dump list of entities. | |
DumpGenerator generates a dump of a given set of entities, excluding redirects.
Wikibase\Repo\Dumpers\DumpGenerator::__construct | ( | $out, | |
EntityPrefetcher | $entityPrefetcher | ||
) |
resource | $out | |
EntityPrefetcher | $entityPrefetcher |
InvalidArgumentException |
|
private |
Dump list of entities.
EntityId[] | $entityIds | |
int | &$dumpCount | The number of entities already dumped (will be updated). |
Wikibase\Repo\Dumpers\DumpGenerator::generateDump | ( | EntityIdPager | $idPager | ) |
Generates a dump, writing to the file handle provided to the constructor.
EntityIdPager | $idPager |
|
abstractprotected |
Produce dump data for specific entity.
EntityId | $entityId |
EntityLookupException | |
StorageException |
Reimplemented in Wikibase\Repo\Dumpers\JsonDumpGenerator, and Wikibase\Repo\Dumpers\RdfDumpGenerator.
|
private |
|
private |
|
private |
|
protected |
Do something after dumping data.
Reimplemented in Wikibase\Repo\Dumpers\JsonDumpGenerator, and Wikibase\Repo\Dumpers\RdfDumpGenerator.
|
protected |
Do something after dumping entity.
int | $dumpCount |
|
protected |
Do something before dumping a batch of entities.
EntityId[] | $entities |
Reimplemented in Wikibase\Repo\Dumpers\RdfDumpGenerator.
|
protected |
Do something before dumping data.
Reimplemented in Wikibase\Repo\Dumpers\JsonDumpGenerator, and Wikibase\Repo\Dumpers\RdfDumpGenerator.
|
protected |
Do something before dumping entity.
int | $dumpCount |
Reimplemented in Wikibase\Repo\Dumpers\JsonDumpGenerator.
Wikibase\Repo\Dumpers\DumpGenerator::setBatchSize | ( | $batchSize | ) |
Sets the batch size for processing.
The batch size is used as the limit when listing IDs via the EntityIdPager::getNextBatchOfIds() method, and also controls the interval of progress reports.
int | $batchSize |
InvalidArgumentException |
Wikibase\Repo\Dumpers\DumpGenerator::setEntityTypesFilter | ( | $types | ) |
Set the entity types to be included in the output.
string[] | null | $types | The desired types (use null for any type). |
Wikibase\Repo\Dumpers\DumpGenerator::setExceptionHandler | ( | ExceptionHandler | $exceptionHandler | ) |
Wikibase\Repo\Dumpers\DumpGenerator::setLimit | ( | $limit | ) |
Set maximum number of entities produced.
int | $limit |
Wikibase\Repo\Dumpers\DumpGenerator::setProgressReporter | ( | MessageReporter | $progressReporter | ) |
Wikibase\Repo\Dumpers\DumpGenerator::setShardingFilter | ( | $shardingFactor, | |
$shard | |||
) |
Set the sharding factor and desired shard.
For instance, to generate four dumps in parallel, use setShardingFilter( 4, 0 ) for the first dump, setShardingFilter( 4, 1 ) for the second dump, etc.
int | $shardingFactor | |
int | $shard |
InvalidArgumentException |
|
protected |
Writers the given string to the output provided to the constructor.
string | $data |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |