tkalkirill commented on a change in pull request #9243:
URL: https://github.com/apache/ignite/pull/9243#discussion_r675667717



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
##########
@@ -5524,58 +5527,82 @@ private void restorePartitionStates(
 
             ExecutorService sysPool = ctx.getSystemExecutorService();
 
-            CountDownLatch completionLatch = new 
CountDownLatch(forGroups.size());
-
             AtomicReference<SortedSet<T3<Long, Long, GroupPartitionId>>> 
topPartRef = new AtomicReference<>();
 
+            SortedSet<T3<Long, Long, GroupPartitionId>> topParts =

Review comment:
       I think it is not worth using the collection to display the top 5 
partitions, since we can restore partitions for a long time and there can be a 
lot of caches and partitions, it is better to leave it as it was through the 
`topPartRef`.

##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
##########
@@ -5524,58 +5527,82 @@ private void restorePartitionStates(
 
             ExecutorService sysPool = ctx.getSystemExecutorService();
 
-            CountDownLatch completionLatch = new 
CountDownLatch(forGroups.size());
-
             AtomicReference<SortedSet<T3<Long, Long, GroupPartitionId>>> 
topPartRef = new AtomicReference<>();
 
+            SortedSet<T3<Long, Long, GroupPartitionId>> topParts =
+                new ConcurrentSkipListSet<>(processedPartitionComparator());
+
             long totalPart = forGroups.stream().mapToLong(grpCtx -> 
grpCtx.affinity().partitions()).sum();
 
-            for (CacheGroupContext grp : forGroups) {
-                sysPool.execute(() -> {
-                    try {
-                        Map<Integer, Long> processed = 
grp.offheap().restorePartitionStates(partStates);
+            int poolSize = ctx.config().getSystemThreadPoolSize();
 
-                        totalProcessed.addAndGet(processed.size());
+            List<List<GroupPartitionId>> partIds = new ArrayList<>(poolSize);

Review comment:
       Why splitting into batches is better than just groups?




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