-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More fully support LRU caching for EntityGroups and EntityRelations.
This provides a middle ground for applications with large relations and entity groups so they don't need to be fully cached (using all that heap space) but can still benefit from LRU caching and otherwise be used similar to when cached and get CacheMessageManager updates appropriately. Note that for both LruCacheGroup and LruSqlEntityRelation, client code will want to continue to avoid operations that result in reading the full table into memory. These changes enable an application to treat these closer to their fully-cached counterparts, but client code must still beware of the performance consequences of an LruCacheGroup.list() or LruSqlEntityRelation.replaceAll() or removeAll(). - SqlEntityRelation - Builder needed its members to be protected so they could be used by the new subclass in LruSqlEntityRelation. - leftValueList() and leftValueSet() had the same guts as leftIDs(), so change to simply use leftIDs() instead. Same for rightValueList() and rightValueSet() using rightIDs(). - Add toString so registered relations are cleanly listed during startup. - CachingEntityRelation - Create new interface to represent functionality shared between CachedRelation and the new LruSqlEntityRelation. - CachedRelation - Implement CachingEntityRelation by changing some existing methods to @OverRide and moving their comments to the new interface. - Fix two bugs in CachedRelation where the wrong listener method was called in removeAll() and replaceAll(). - LruSqlEntityRelation - Create new class to provide an LRU cache of relations, similar to what LruCacheGroup does for entities. - EntityStore - Change references of CachedRelation to CachingEntityRelation so LruSqlEntityRelation can be treated the same as CachedRelation. - LruCacheGroup - Add map() for querying by a set of IDs instead of relying on a separate query per desired object. - Add querySingle() for querying by arbitrary criteria. Useful for login when User is an LruCacheGroup. - Default to distribute=true so LruCacheGroups send/receive cache messages. - CacheMessageManager - Appropriately handle messages for an LruCacheGroup to keep them updated just like a CacheGroup is. This enables easier transitions from CacheGroup to LruCacheGroup. - Change references of CachedRelation to CachingEntityRelation so LruSqlEntityRelation can be kept updated just the same as CachedRelation.
- Loading branch information
Keith R. Gustafson
committed
Mar 9, 2023
1 parent
e5d408f
commit 6a504e9
Showing
7 changed files
with
683 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.