tkalkirill commented on a change in pull request #9327:
URL: https://github.com/apache/ignite/pull/9327#discussion_r705311334
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
##########
@@ -5614,17 +5642,44 @@ private void restorePartitionStates(
throw restoreStateError.get();
if (log.isInfoEnabled()) {
- SortedSet<T3<Long, Long, GroupPartitionId>> t = printTop ?
topPartRef.get() : null;
+ SortedSet<T3<Long, Long, GroupPartitionId>> t =
+ printTop ? collectTopProcessedParts(threadCtxs,
topPartRefLimit) : null;
+
+ long totalProcessed = threadCtxs.stream().mapToLong(c ->
c.processedCnt).sum();
log.info("Finished restoring partition state for local groups
[" +
"groupsProcessed=" + forGroups.size() +
- ", partitionsProcessed=" + totalProcessed.get() +
+ ", partitionsProcessed=" + totalProcessed +
", time=" + U.humanReadableDuration(U.currentTimeMillis()
- startRestorePart) +
(t == null ? "" : ", topProcessedPartitions=" +
toStringTopProcessingPartitions(t, forGroups)) +
"]");
}
}
+ /**
+ * Collects top processed partitions from thread local contexts of
restore partition state process.
+ *
+ * @param threadCtxs Thread local contexts.
+ * @param topPartRefLimit Limit of top partitions collection size.
+ */
+ private SortedSet<T3<Long, Long, GroupPartitionId>>
collectTopProcessedParts(
Review comment:
It may not work correctly in a multi-thread.
--
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]