sk0x50 commented on a change in pull request #8645:
URL: https://github.com/apache/ignite/pull/8645#discussion_r556422158
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
##########
@@ -329,4 +372,64 @@ private String fold(AffinityTopologyVersion topVer,
Map<Integer, Map<UUID, Long>
return sb.toString();
}
+
+ /**
+ * Folds given map of invalid partition states to string representation
+ * in the following format:
+ * Part [id]: [consistentId=value meta=[updCnt=value, size=value]]
+ * @param topVer Topology version.
+ * @param invalidPartitionsCounters Invalid partitions counters map.
+ * @param invalidPartitionsSize Invalid partitions size map.
+ * @return value is String in the following format: Part [id]:
+ * [consistentId=value meta=[updCnt=value, size=value]]
+ */
+ private String fold(AffinityTopologyVersion topVer, Map<Integer, Map<UUID,
Long>> invalidPartitionsCounters,
+ Map<Integer, Map<UUID, Long>> invalidPartitionsSize) {
+ SB sb = new SB();
+
+ NavigableMap<Integer, Map<UUID, IgnitePair<Long>>> sortedAllPartitions
= new TreeMap<>();
+
+ Set<Integer> allKeys = new
HashSet<>(invalidPartitionsCounters.keySet());
+
+ allKeys.addAll(invalidPartitionsSize.keySet());
+
+ for (Integer p : allKeys) {
+ Map<UUID, IgnitePair<Long>> map = new HashMap<>();
+
+ fillMapForPartition(invalidPartitionsCounters.get(p), map, true);
+ fillMapForPartition(invalidPartitionsSize.get(p), map, false);
+
+ sortedAllPartitions.put(p, map);
+ }
+
+ for (Map.Entry<Integer, Map<UUID, IgnitePair<Long>>> p :
sortedAllPartitions.entrySet()) {
+ sb.a("Part ").a(p.getKey()).a(": [");
+ for (Map.Entry<UUID, IgnitePair<Long>> e :
p.getValue().entrySet()) {
+ Object consistentId = cctx.discovery().node(topVer,
e.getKey()).consistentId();
+ sb.a("consistentId=").a(consistentId).a("
meta=[updCnt=").a(e.getValue().get1())
+ .a(", size=").a(e.getValue().get2()).a("] ");
+ }
+ sb.a("] ");
+ }
+
+ return sb.toString();
+ }
+
+ /**
+ * Add pair of counters and size in result map.
Review comment:
`Adds pair of counters and size in result map`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]