shishkovilja commented on code in PR #10359:
URL: https://github.com/apache/ignite/pull/10359#discussion_r1011864485
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyResultV2.java:
##########
@@ -266,31 +272,59 @@ private void printConflicts(Consumer<String> printer) {
int hashConflictsSize = hashConflicts().size();
printer.accept("The check procedure has failed, conflict partitions
has been found: " +
- "[counterConflicts=" + cntrConflictsSize + ", hashConflicts=" +
hashConflictsSize + "]\n");
+ "[counterConflicts=" + cntrConflictsSize + ", hashConflicts=" +
hashConflictsSize + "]" + nl());
+
+ Set<PartitionKeyV2> allConflicts = new HashSet<>();
if (!F.isEmpty(counterConflicts())) {
- printer.accept("Update counter conflicts:\n");
+ allConflicts.addAll(counterConflicts().keySet());
+
+ printer.accept("Update counter conflicts:" + nl());
for (Map.Entry<PartitionKeyV2, List<PartitionHashRecordV2>> entry
: counterConflicts().entrySet()) {
- printer.accept("Conflict partition: " + entry.getKey() + "\n");
+ printer.accept("Conflict partition: " + entry.getKey() + nl());
- printer.accept("Partition instances: " + entry.getValue() +
"\n");
+ printer.accept("Partition instances: " + entry.getValue() +
nl());
}
- printer.accept("\n");
+ printer.accept(nl());
}
if (!F.isEmpty(hashConflicts())) {
- printer.accept("Hash conflicts:\n");
+ allConflicts.addAll(hashConflicts().keySet());
+
+ printer.accept("Hash conflicts:" + nl());
for (Map.Entry<PartitionKeyV2, List<PartitionHashRecordV2>> entry
: hashConflicts().entrySet()) {
- printer.accept("Conflict partition: " + entry.getKey() + "\n");
+ printer.accept("Conflict partition: " + entry.getKey() + nl());
- printer.accept("Partition instances: " + entry.getValue() +
"\n");
+ printer.accept("Partition instances: " + entry.getValue() +
nl());
}
}
- printer.accept("\n");
+ printer.accept(nl());
+ printer.accept("Total:" + nl());
+
+ Map<String, TreeSet<Integer>> conflictsSummary = allConflicts.stream()
+ .collect(Collectors.groupingBy(
+ PartitionKeyV2::groupName,
+ Collectors.mapping(
+ PartitionKeyV2::partitionId,
+ Collectors.toCollection(TreeSet::new))));
+
+ for (String groupName : conflictsSummary.keySet()) {
Review Comment:
Good point. I'll prepare a fix soon.
--
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]