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

PropertyTermStoreWriter implementation for the 2019 SQL based secondary property term storage. More...

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

Public Member Functions

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

Private Member Functions

 getDbw ()
 
 submitJobToCleanTermStorageRowsIfUnused (array $termInLangIdsToClean)
 
 acquireAndInsertTerms (PropertyId $propertyId, Fingerprint $fingerprint)
 Acquire term in lang IDs for the given Fingerprint, store them in wbt_property_terms for the given property ID, and return term in lang IDs that are no longer referenced and might now need to be cleaned up. More...
 
 deleteTermsWithoutClean (PropertyId $propertyId)
 Delete wbt_property_terms rows for the given property 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

PropertyTermStoreWriter implementation for the 2019 SQL based secondary property term storage.

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

See also
Item & Property Terms

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ acquireAndInsertTerms()

Wikibase\Lib\Store\Sql\Terms\DatabasePropertyTermStoreWriter::acquireAndInsertTerms ( PropertyId  $propertyId,
Fingerprint  $fingerprint 
)
private

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

Parameters
PropertyId$propertyId
Fingerprint$fingerprint
Returns
int[] wbpt_term_in_lang_ids to that are no longer used by $propertyId The returned term in lang IDs might still be used in wbt_property_terms rows for other property 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\DatabasePropertyTermStoreWriter::deleteTerms ( PropertyId  $propertyId)

◆ deleteTermsWithoutClean()

Wikibase\Lib\Store\Sql\Terms\DatabasePropertyTermStoreWriter::deleteTermsWithoutClean ( PropertyId  $propertyId)
private

Delete wbt_property_terms rows for the given property 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_property_terms rows for other property IDs, and this should be checked just before cleanup. However, that may happen in a different transaction than this call.)

Parameters
PropertyId$propertyId
Returns
int[]

◆ getDbw()

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

◆ storeTerms()

Wikibase\Lib\Store\Sql\Terms\DatabasePropertyTermStoreWriter::storeTerms ( PropertyId  $propertyId,
Fingerprint  $fingerprint 
)

◆ submitJobToCleanTermStorageRowsIfUnused()

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

Member Data Documentation

◆ $jobQueueGroup

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

◆ $loadBalancer

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

◆ $stringNormalizer

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

◆ $termInLangIdsAcquirer

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

◆ $termInLangIdsResolver

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

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