yurinaryshkin commented on code in PR #11319:
URL: https://github.com/apache/ignite/pull/11319#discussion_r1574534314
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java:
##########
@@ -1108,7 +1110,28 @@ private Metas getOrAllocateCacheMetas() throws
IgniteCheckedException {
try {
int cleared = 0;
+ // Use random shift to reduce contention.
+ int shift =
ThreadLocalRandom.current().nextInt(F.size(cacheDataStores().iterator()));
+
+ int cnt = 0;
+ for (CacheDataStore store : cacheDataStores()) {
Review Comment:
As far as I understood, the logic here is to split cacheDataStores() into 2
parts at random index and after that process right sublist before the left
sublist. Can this change be simplified to minimize code duplication? For
example, construct a new list from 2 sublists and process it as before.
--
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]