XianReallyHot-ZZH opened a new pull request, #13712:
URL: https://github.com/apache/ignite/pull/13712

   JIRA ticket: https://issues.apache.org/jira/browse/IGNITE-12702
   
   `@AffinityKeyMapped` placed on a field of a cache **value** class is 
silently ignored, because affinity is calculated by the cache key only. Such a 
mistake is simple to make and pretty hard to track down.
   
   This change prints a warning (once per type per node) when a cache value's 
binary type has an affinity key field:
   
       Affinity key field 'departmentId' of class '...EmployeeValue' is 
ignored, because the class is used as a cache value. Affinity is calculated by 
the cache key: make sure that the affinity key field is defined on the key 
class (@AffinityKeyMapped has effect only for cache keys).
   
   Detection happens in `CacheObjectBinaryProcessorImpl#toCacheObject`, the 
point where a user value is wrapped into a binary cache object, so both POJO 
puts and pre-built `BinaryObject` (keepBinary) puts are covered. Key processing 
(`toCacheKeyObject`) is untouched.
   
   Tests: `AffinityKeyMappedOnValueWarningSelfTest`
   - value class with `@AffinityKeyMapped` field, two puts → exactly one 
warning (once per type);
   - correctly annotated key class → no warning.


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