Commit graph

9 commits

Author SHA1 Message Date
jenkins-bot
5008ca185e Merge "UserQueryBuilder: abstraction for actor table queries." 2021-02-23 12:27:26 +00:00
jenkins-bot
9cd7d35500 Merge "Add a few tests for ActorStore corner cases" 2021-02-22 20:35:24 +00:00
Petr Pchelko
87a5cb4673 UserQueryBuilder: abstraction for actor table queries.
This introduces a specialized SelectQueryBuilder for
queries related to actor table. So far it's fairly basic,
but in future it is intended to grow.

This patch only introduces the new abstraction, using
it will be separated into separate patches.

Bug: T274223
Change-Id: Ibb1c58016e3956a46bfaf1a9f51f265114bb9ace
2021-02-22 11:47:07 -07:00
Cindy Cicalese
fd71596f97 Add caching to ActorStore
Bug: T273974
Depends-On: I8c18d86fe42056fbb676467a6657fd2f62e9c998
Change-Id: Iff5e3f07ac5b1192dd7a9f7f37589d8eae09a746
2021-02-22 09:25:13 -07:00
Petr Pchelko
49220ff4ab Add a few tests for ActorStore corner cases
Change-Id: Iba6c5d8fa15952cfef689f8f151f262aaff46417
2021-02-16 22:52:47 -06:00
Umherirrender
8de3b7d324 Use static closures where safe to use
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.

Created by I25a17fb22b6b669e817317a0f45051ae9c608208

Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
2021-02-11 00:13:52 +00:00
Petr Pchelko
4d8dc6b992 Use ActorStore in RevisionStore
Bug: T273290
Change-Id: Iff9b67455d337ea03cb728dd570c4ce760c39e49
2021-02-10 14:37:54 -06:00
Petr Pchelko
1398a72999 Reorder arguments in ActorStore::newActorFromRowFields
The order $userId, $name, $actorId is more consistent
with existing order of arguments in UIV constructor,
User::newFromAnyId etc. Even though it's not as logical
as placing the primary key argument first, it's more practical.

Change-Id: Ic36c0ee451cf6825976e374f0c2f721085c0a507
2021-02-09 08:46:24 -06:00
Petr Pchelko
8d2c674ab0 Introduce ActorStore, ActorLookup and ActorFactory.
The ActorNormalization factory methods create
UserIdentityValue from the database rows, either via
fields of a joined table, or via a row from actor table.
They assume that the actor_id exist and throw othervise.

ActorNormalization is a storage-layer service providing
access to finding and acquiring actor_id.

The UserIdentityLookup methods do not instantiate new actor
on demand, they just find an appropriate row in the actor
table and return the result.

Bug: T272689
Depends-On: I74d81f3f0233efb17fc8df5178e4c477cc669c6f
Change-Id: Icfa1daca960c696a8cef8adab5eab53985802858
2021-02-08 10:06:46 -06:00