feat(cache): introduce GravitinoCache interface with Caffeine and no-op implementations#10794
Closed
yuqi1129 wants to merge 2 commits intoapache:mainfrom
Closed
feat(cache): introduce GravitinoCache interface with Caffeine and no-op implementations#10794yuqi1129 wants to merge 2 commits intoapache:mainfrom
yuqi1129 wants to merge 2 commits intoapache:mainfrom
Conversation
- Add upgrade SQL script (1.2.0 -> 1.3.0) with updated_at columns on role_meta, user_meta, group_meta, owner_meta, and entity_change_log table - Add result record types in po/auth: UserAuthInfo, GroupAuthInfo, OwnerInfo, RoleUpdatedAt, ChangedOwnerInfo, EntityChangeRecord - Add touchUpdatedAt/batchGetUpdatedAt to RoleMetaMapper and providers - Add touchUpdatedAt/getUserInfo to UserMetaMapper and providers - Add touchUpdatedAt/getGroupInfoByUserId to GroupMetaMapper and providers - Add selectOwnerByMetadataObjectId/selectChangedOwners to OwnerMetaMapper - Create EntityChangeLogMapper with selectChanges/insertChange/pruneOldEntries - Register EntityChangeLogMapper in DefaultMapperPackageProvider Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…op implementations - Add GravitinoCache<K, V> interface with get/put/invalidate/invalidateByPrefix/size/close - Implement CaffeineGravitinoCache backed by Caffeine with TTL and maxSize config - Implement NoOpsGravitinoCache for testing (all methods are no-ops) - invalidateByPrefix enables cascade invalidation for DDL operations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 task
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
GravitinoCache<K, V>interface (extendsCloseable) withgetIfPresent,put,invalidate,invalidateAll,invalidateByPrefix,size,closeCaffeineGravitinoCache<K, V>backed by Caffeine with configurablemaxSizeandttlSeconds;invalidateByPrefixdoes an O(n) key scan (acceptable for rare DDL invalidations)NoOpsGravitinoCache<K, V>for testing (all operations are no-ops)Builds on: #10793
Why are the changes needed?
A shared cache abstraction allows the auth path caches (
userRoleCache,groupRoleCache,metadataIdCache,ownerRelCache,loadedRoles) to be swapped between real Caffeine caches and no-op caches in tests without changing the call sites.Does this PR introduce any user-facing changes?
No.
How was this patch tested?
./gradlew :core:test -PskipITs🤖 Generated with Claude Code