This is an automated email from the ASF dual-hosted git repository.

namelchev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 6cca09c3e79 IGNITE-28253 Removed redundant map keys from 
IncrementalSnapshotVerifyResult message (#12900)
6cca09c3e79 is described below

commit 6cca09c3e795b1cab679099f2c347b52b9cc1fa6
Author: Nikita Amelchev <[email protected]>
AuthorDate: Wed Mar 18 16:36:35 2026 +0300

    IGNITE-28253 Removed redundant map keys from 
IncrementalSnapshotVerifyResult message (#12900)
---
 .../persistence/snapshot/IncrementalSnapshotVerify.java   | 15 +++++----------
 .../snapshot/IncrementalSnapshotVerifyResult.java         | 14 ++++++--------
 .../cache/persistence/snapshot/SnapshotChecker.java       | 13 +++++++++++--
 3 files changed, 22 insertions(+), 20 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerify.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerify.java
index 094dceb1820..4ff5e0311cf 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerify.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerify.java
@@ -255,21 +255,16 @@ public class IncrementalSnapshotVerify implements 
Supplier<IncrementalSnapshotVe
             for (Map.Entry<GridCacheVersion, Set<Short>> tx: 
txPrimParticipatingNodes.entrySet())
                 calcTxHash.accept(tx.getKey(), tx.getValue());
 
-            Map<Object, TransactionsHashRecord> txHashRes = 
nodesTxHash.entrySet().stream()
+            Collection<TransactionsHashRecord> txHashRes = 
nodesTxHash.entrySet().stream()
                 .map(e -> new TransactionsHashRecord(
                     sft.consistentId(),
                     blt.compactIdMapping().get(e.getKey()),
                     e.getValue().hash
                 ))
-                .collect(Collectors.toMap(
-                    TransactionsHashRecord::remoteConsistentId,
-                    Function.identity()
-                ));
+                .collect(Collectors.toCollection(ArrayList::new));
 
-            Map<PartitionKey, PartitionHashRecord> partHashRes = 
partMap.entrySet().stream()
-                .collect(Collectors.toMap(
-                    Map.Entry::getKey,
-                    e -> new PartitionHashRecord(
+            Collection<PartitionHashRecord> partHashRes = 
partMap.entrySet().stream()
+                .map(e -> new PartitionHashRecord(
                         e.getKey(),
                         false,
                         sft.consistentId(),
@@ -278,7 +273,7 @@ public class IncrementalSnapshotVerify implements 
Supplier<IncrementalSnapshotVe
                         null,
                         new VerifyPartitionContext(e.getValue())
                     )
-                ));
+                ).collect(Collectors.toCollection(ArrayList::new));
 
             if (log.isInfoEnabled()) {
                 log.info("Verify incremental snapshot procedure finished " +
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerifyResult.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerifyResult.java
index dc5b3cb6245..7a3db0d2485 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerifyResult.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotVerifyResult.java
@@ -19,8 +19,6 @@ package 
org.apache.ignite.internal.processors.cache.persistence.snapshot;
 
 import java.io.Serializable;
 import java.util.Collection;
-import java.util.Map;
-import org.apache.ignite.internal.management.cache.PartitionKey;
 import org.apache.ignite.internal.pagemem.wal.record.DataEntry;
 import org.apache.ignite.internal.processors.cache.verify.PartitionHashRecord;
 import 
org.apache.ignite.internal.processors.cache.verify.TransactionsHashRecord;
@@ -32,13 +30,13 @@ public class IncrementalSnapshotVerifyResult implements 
Serializable {
     private static final long serialVersionUID = 0L;
 
     /** Transaction hashes collection. */
-    private Map<Object, TransactionsHashRecord> txHashRes;
+    private Collection<TransactionsHashRecord> txHashRes;
 
     /**
      * Partition hashes collection. Value is a hash of data entries {@link 
DataEntry} from WAL segments included
      * into the incremental snapshot.
      */
-    private Map<PartitionKey, PartitionHashRecord> partHashRes;
+    private Collection<PartitionHashRecord> partHashRes;
 
     /** Partially committed transactions' collection. */
     private Collection<GridCacheVersion> partiallyCommittedTxs;
@@ -53,8 +51,8 @@ public class IncrementalSnapshotVerifyResult implements 
Serializable {
 
     /** */
     IncrementalSnapshotVerifyResult(
-        Map<Object, TransactionsHashRecord> txHashRes,
-        Map<PartitionKey, PartitionHashRecord> partHashRes,
+        Collection<TransactionsHashRecord> txHashRes,
+        Collection<PartitionHashRecord> partHashRes,
         Collection<GridCacheVersion> partiallyCommittedTxs,
         Collection<Exception> exceptions
     ) {
@@ -65,12 +63,12 @@ public class IncrementalSnapshotVerifyResult implements 
Serializable {
     }
 
     /** */
-    public Map<PartitionKey, PartitionHashRecord> partHashRes() {
+    public Collection<PartitionHashRecord> partHashRes() {
         return partHashRes;
     }
 
     /** */
-    public Map<Object, TransactionsHashRecord> txHashRes() {
+    public Collection<TransactionsHashRecord> txHashRes() {
         return txHashRes;
     }
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotChecker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotChecker.java
index 4f81025d0a2..4a3d7bfe7da 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotChecker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotChecker.java
@@ -26,6 +26,8 @@ import java.util.Set;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
 import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
@@ -35,6 +37,7 @@ import 
org.apache.ignite.internal.management.cache.IdleVerifyResult;
 import org.apache.ignite.internal.management.cache.PartitionKey;
 import 
org.apache.ignite.internal.processors.cache.persistence.filename.SnapshotFileTree;
 import org.apache.ignite.internal.processors.cache.verify.PartitionHashRecord;
+import 
org.apache.ignite.internal.processors.cache.verify.TransactionsHashRecord;
 import org.apache.ignite.internal.util.typedef.F;
 import org.jetbrains.annotations.Nullable;
 
@@ -103,12 +106,18 @@ public class SnapshotChecker {
             if (!F.isEmpty(res.partiallyCommittedTxs()))
                 bldr.addPartiallyCommited(nodeRes.getKey(), 
res.partiallyCommittedTxs());
 
-            bldr.addPartitionHashes(res.partHashRes());
+            Map<PartitionKey, PartitionHashRecord> partHashRes = 
res.partHashRes().stream()
+                .collect(Collectors.toMap(PartitionHashRecord::partitionKey, 
Function.identity()));
+
+            bldr.addPartitionHashes(partHashRes);
 
             if (log.isDebugEnabled())
                 log.debug("Handle VerifyIncrementalSnapshotJob result [node=" 
+ nodeRes.getKey() + ", taskRes=" + res + ']');
 
-            bldr.addIncrementalHashRecords(nodeRes.getKey(), res.txHashRes());
+            Map<Object, TransactionsHashRecord> txHashRes = 
res.txHashRes().stream().collect(
+                Collectors.toMap(TransactionsHashRecord::remoteConsistentId, 
Function.identity()));
+
+            bldr.addIncrementalHashRecords(nodeRes.getKey(), txHashRes);
         }
 
         return bldr.build();

Reply via email to