|
Wikibase
MediaWiki Wikibase extension
|
Helper class for updating the wbc_entity_usage table. More...
Public Member Functions | |
| __construct (EntityIdParser $idParser, IDatabase $writeConnection, $batchSize=100, $tableName=null, $addUsagesBatchSize=500) | |
| addUsages ( $pageId, array $usages) | |
| queryUsages ( $pageId) | |
| pruneUsages ( $pageId) | |
| Removes all usage tracking for a given page. | |
| removeUsages ( $pageId, array $usages) | |
| getPagesUsing (array $entityIds, array $aspects=[]) | |
| getUnusedEntities (array $entityIds) | |
| setAddUsagesBatchSize ( $addUsagesBatchSize) | |
| Set the batch size for adding entity usage records. | |
Public Attributes | |
| const | DEFAULT_TABLE_NAME = 'wbc_entity_usage' |
Private Member Functions | |
| getAffectedRowIds ( $pageId, array $usages) | |
| makeUsageRows ( $pageId, array $usages) | |
| getEntityIdStrings (array $entityIds) | |
| convertRowsToUsages (Traversable $rows) | |
| foldRowsIntoPageEntityUsages (Traversable $rows) | |
| getUsedEntityIdStrings (array $idStrings) | |
| Returns those entity ids which are used from a given set of entity ids. | |
| getUsedEntityIdStringsQueries (array $idStrings) | |
| getPrimaryKeys (array $where, $method) | |
| Returns the primary keys for the given where clause. | |
| getUsedEntityIdStringsMySql (array $subQueries) | |
Private Attributes | |
| $idParser | |
| $writeConnection | |
| $readConnection | |
| $loadBalancerFactory | |
| $batchSize | |
| $tableName | |
| $addUsagesBatchSize | |
Helper class for updating the wbc_entity_usage table.
This is used internally by SqlUsageTracker.
| Wikibase\Client\Usage\Sql\EntityUsageTable::__construct | ( | EntityIdParser | $idParser, |
| IDatabase | $writeConnection, | ||
$batchSize = 100, |
|||
$tableName = null, |
|||
$addUsagesBatchSize = 500 |
|||
| ) |
| EntityIdParser | $idParser | |
| IDatabase | $writeConnection | |
| int | $batchSize | Batch size for database queries on the entity usage table, including INSERTs, SELECTs, and DELETEs. Defaults to 100. |
| string | null | $tableName | defaults to wbc_entity_usage |
| int | $addUsagesBatchSize | Batch size for adding entity usage records. Can also be set after construction. |
| InvalidArgumentException |
| Wikibase\Client\Usage\Sql\EntityUsageTable::addUsages | ( | $pageId, | |
| array | $usages | ||
| ) |
| int | $pageId | |
| EntityUsage[] | $usages |
| InvalidArgumentException |
|
private |
| Traversable | $rows |
|
private |
| Traversable | $rows |
|
private |
| int | $pageId | |
| EntityUsage[] | $usages |
| DBUnexpectedError | |
| MWException |
|
private |
| EntityId[] | $entityIds |
| Wikibase\Client\Usage\Sql\EntityUsageTable::getPagesUsing | ( | array | $entityIds, |
| array | $aspects = [] |
||
| ) |
| EntityId[] | $entityIds | |
| string[] | $aspects |
|
private |
Returns the primary keys for the given where clause.
| array | $where | |
| string | $method | Calling method |
| Wikibase\Client\Usage\Sql\EntityUsageTable::getUnusedEntities | ( | array | $entityIds | ) |
| EntityId[] | $entityIds |
|
private |
Returns those entity ids which are used from a given set of entity ids.
| string[] | $idStrings |
|
private |
| string[] | $subQueries |
|
private |
| string[] | $idStrings |
|
private |
| int | $pageId | |
| EntityUsage[] | $usages |
| InvalidArgumentException |
| Wikibase\Client\Usage\Sql\EntityUsageTable::pruneUsages | ( | $pageId | ) |
Removes all usage tracking for a given page.
| int | $pageId |
| InvalidArgumentException |
| Wikibase\Client\Usage\Sql\EntityUsageTable::queryUsages | ( | $pageId | ) |
| int | $pageId |
| InvalidArgumentException |
| Wikibase\Client\Usage\Sql\EntityUsageTable::removeUsages | ( | $pageId, | |
| array | $usages | ||
| ) |
| int | $pageId | |
| EntityUsage[] | $usages |
| InvalidArgumentException |
| Wikibase\Client\Usage\Sql\EntityUsageTable::setAddUsagesBatchSize | ( | $addUsagesBatchSize | ) |
Set the batch size for adding entity usage records.
This can also be set in the constructor.
| int | $addUsagesBatchSize |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| const Wikibase\Client\Usage\Sql\EntityUsageTable::DEFAULT_TABLE_NAME = 'wbc_entity_usage' |