yuqi1129 opened a new pull request, #10795:
URL: https://github.com/apache/gravitino/pull/10795
## What changes were proposed in this pull request?
- Adds `handleEntityStructuralChange` default no-op method to
`GravitinoAuthorizer` interface for backward compatibility
- Adds new fields to `JcasbinAuthorizer`:
- `userRoleCache` (`GravitinoCache<String, CachedUserRoles>`)
- `groupRoleCache` (`GravitinoCache<String, CachedGroupRoles>`)
- `metadataIdCache` (`GravitinoCache<String, Long>`)
- `ownerRelCache` (`GravitinoCache<Long, Optional<Long>>`)
- `maxOwnerUpdatedAt` / `maxEntityCreatedAt` (`AtomicLong` version
pointers)
- `changePoller` (`ScheduledExecutorService`)
- Adds `CachedUserRoles` and `CachedGroupRoles` inner records with version
sentinel
- Implements `startChangePoller`, `pollOwnerChanges`, `pollEntityChanges`
using `SessionUtils` with `OwnerMetaMapper` and `EntityChangeLogMapper`
- Implements `handleEntityStructuralChange` using
`metadataIdCache.invalidateByPrefix`
- Adds `buildCacheKey` / `isNonLeaf` static helpers for cache key
construction
- Wires `ownerRelCache` invalidation into `handleMetadataOwnerChange`
- Shuts down `changePoller` and closes new caches in `close()`
Builds on: #10794
## Why are the changes needed?
Pre-populates the id-mapping and owner caches so subsequent auth requests do
not need to hit the DB for name→id resolution. The change poller drives
targeted cache invalidation on HA peer nodes using the DB tables added in the
Phase 1 PR.
## Does this PR introduce _any_ user-facing changes?
No.
## How was this patch tested?
- [ ] `./gradlew :server-common:test -PskipITs`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]