Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter Class Reference

ItemTermStoreWriter implementation for the 2019 SQL based secondary item term storage. More...

+ Inheritance diagram for Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter:
+ Collaboration diagram for Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter:

Public Member Functions

 __construct (ILoadBalancer $loadBalancer, JobQueueGroup $jobQueueGroup, TermInLangIdsAcquirer $termInLangIdsAcquirer, TermInLangIdsResolver $termInLangIdsResolver, StringNormalizer $stringNormalizer)
 
 storeTerms (ItemId $itemId, Fingerprint $fingerprint)
 
 deleteTerms (ItemId $itemId)
 

Private Member Functions

 getDbw ()
 
 submitJobToCleanTermStorageRowsIfUnused (array $termInLangIdsToClean)
 
 acquireAndInsertTerms (ItemId $itemId, Fingerprint $fingerprint)
 Acquire term in lang IDs for the given Fingerprint, store them in wbt_item_terms for the given item ID, and return term in lang IDs that are no longer referenced and might now need to be cleaned up. More...
 
 deleteTermsWithoutClean (ItemId $itemId)
 Delete wbt_item_terms rows for the given item ID, and return term in lang IDs that are no longer referenced and might now need to be cleaned up. More...
 

Private Attributes

 $loadBalancer
 
 $termInLangIdsAcquirer
 
 $termInLangIdsResolver
 
 $stringNormalizer
 
 $jobQueueGroup
 

Detailed Description

ItemTermStoreWriter implementation for the 2019 SQL based secondary item term storage.

This can only be used to write to Item term stores on the local database.

See also
Item & Property Terms

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::__construct ( ILoadBalancer  $loadBalancer,
JobQueueGroup  $jobQueueGroup,
TermInLangIdsAcquirer  $termInLangIdsAcquirer,
TermInLangIdsResolver  $termInLangIdsResolver,
StringNormalizer  $stringNormalizer 
)

Member Function Documentation

◆ acquireAndInsertTerms()

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::acquireAndInsertTerms ( ItemId  $itemId,
Fingerprint  $fingerprint 
)
private

Acquire term in lang IDs for the given Fingerprint, store them in wbt_item_terms for the given item ID, and return term in lang IDs that are no longer referenced and might now need to be cleaned up.

Parameters
ItemId$itemId
Fingerprint$fingerprint
Returns
int[] wbit_term_in_lang_ids to that are no longer used by $itemId The returned term in lang IDs might still be used in wbt_item_terms rows for other item IDs or elsewhere, and this should be checked just before cleanup. However, that may happen in a different transaction than this call.

◆ deleteTerms()

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::deleteTerms ( ItemId  $itemId)

◆ deleteTermsWithoutClean()

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::deleteTermsWithoutClean ( ItemId  $itemId)
private

Delete wbt_item_terms rows for the given item ID, and return term in lang IDs that are no longer referenced and might now need to be cleaned up.

(The returned term in lang IDs might still be used in wbt_item_terms rows for other item IDs or elsewhere, and this should be checked just before cleanup. However, that may happen in a different transaction than this call.)

Parameters
ItemId$itemId
Returns
int[]

◆ getDbw()

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::getDbw ( )
private

◆ storeTerms()

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::storeTerms ( ItemId  $itemId,
Fingerprint  $fingerprint 
)

◆ submitJobToCleanTermStorageRowsIfUnused()

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::submitJobToCleanTermStorageRowsIfUnused ( array  $termInLangIdsToClean)
private

Member Data Documentation

◆ $jobQueueGroup

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::$jobQueueGroup
private

◆ $loadBalancer

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::$loadBalancer
private

◆ $stringNormalizer

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::$stringNormalizer
private

◆ $termInLangIdsAcquirer

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::$termInLangIdsAcquirer
private

◆ $termInLangIdsResolver

Wikibase\Lib\Store\Sql\Terms\DatabaseItemTermStoreWriter::$termInLangIdsResolver
private

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