Abyss-lord opened a new pull request, #7330:
URL: https://github.com/apache/gravitino/pull/7330

   ### What changes were proposed in this pull request?
   
   Fix some bugs in EntityCache and add test cases.
   
   - [X] Implement the methods related to the `SupportsEntityStoreCache` and 
`SupportsRelationEntityCache` interface in `CaffeineEntityCache`.
   - [X] Add unit tests for both index and cache.
   - [ ] Use JCStress to perform multi-threaded testing on 
`CaffeineEntityCache` and the `CacheIndex`.
   
   | Category                | Test Case Description                            
 | Method(s)                           |
   | ----------------------- | 
------------------------------------------------- | 
----------------------------------- |
   | **Basic Functionality** | Basic put/get/getIfPresent operations            
 | `testPutAndGet`, `testGetIfPresent` |
   |                         | Same identifier with different entity types      
 | `testPutSameIdentifierEntities`     |
   |                         | Size counting                                    
 | `testSize`                          |
   |                         | Clear the cache                                  
 | `testClear`                         |
   | **Cache Loading**       | Hit from cache, no store access                  
 | `testGetFromCache`                  |
   |                         | Miss from cache, fallback to store               
 | `testGetFromStore`                  |
   |                         | Reload after invalidation                        
 | `testRemoveThenReload`              |
   | **Invalidation**        | Invalidate by METALAKE/CATALOG/SCHEMA/TABLE 
level | `testInvalidate*` series            |
   |                         | Invalidate non-existent entity                   
 | `testRemoveNonExistentEntity`       |
   | **Relation Handling**   | Put/Get/Invalidate entity relations              
 | Covered in multiple tests           |
   |                         | Fallback to `listEntitiesByRelation` from store  
 | `testGetFromStore`                  |
   | **Eviction Policies**   | Expire by time                                   
 | `testExpireByTime`                  |
   |                         | Expire by size                                   
 | `testExpireBySize`                  |
   |                         | Expire by weight                                 
 | `testExpireByWeight`                |
   |                         | Exceed max weight immediately                    
 | `testExpireByWeightExceedMaxWeight` |
   | **Weight Logic**        | Correctness of entity weight calculation         
 | `testWeightCalculation`             |
   | **Error & Boundary**    | Store throws exception                           
 | `testLoadEntityThrowException`      |
   |                         | Store is null                                    
 | `testNullEntityStore`               |
   |                         | Null argument checks                             
 | `test*WithNull` methods             |
   | **Helper/Validation**   | Identifier equality check                        
 | `testEquals`                        |
   
   ### Why are the changes needed?
   
   Fix: #7177
   
   ### Does this PR introduce _any_ user-facing change?
   
   no
   
   ### How was this patch tested?
   
   local test.
   


-- 
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]

Reply via email to