daniel added a comment.

So we somehow need to apply the prefetching capabilities of a TermBuffer to a multi-repo scenario. In particular, prefetchTerms() needs to partition the list of EntityIds by repo, and then forward each list to an underlying, per-repo TermBuffer.

Implementation:

Make a dispatching TermBuffer. It can be based on EntityTermLookupBase, just like BufferingTermLookup. When forwarding prefetchTerms(), the list of EntityIds is partitioned by repo. The dispatching TermBuffer does not need to implement caching.

The dispatching TermBuffer would get a list of TermBuffer (by repo), and a list of TermLookups (per repo). Alternatively, it takes a single list of objects that are each required to implement both these interfaces (Assert::prameterElementType could be expanded to support Foo+Bar as a notation for checking this). We could also make a combined interface, TermLooklupAndBuffer or something.

Caching will continue to be done by per-repo instances of BufferingTermLookup. This seems sensible since cache location and duration may depend on the target repo (e.g. more aggressive caching for repos accessed via API).


TASK DETAIL
https://phabricator.wikimedia.org/T148141

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: WMDE-leszek, daniel
Cc: gerritbot, daniel, WMDE-leszek, Aklapper, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to