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

shishkovilja 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 8d1cf53421b IGNITE-26735 GridDhtPartitionSupplyMessage minor 
refactoring (#12479)
8d1cf53421b is described below

commit 8d1cf53421b6ed9fc231cc54603e4e267810d0cb
Author: Ilya Shishkov <[email protected]>
AuthorDate: Tue Nov 4 21:41:19 2025 +0300

    IGNITE-26735 GridDhtPartitionSupplyMessage minor refactoring (#12479)
---
 .../dht/preloader/GridDhtPartitionDemander.java    |  4 +-
 .../preloader/GridDhtPartitionSupplyMessage.java   | 43 +++++++---------------
 2 files changed, 16 insertions(+), 31 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index e6ff9257eec..87dd49a9322 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -599,7 +599,7 @@ public class GridDhtPartitionDemander {
 
                         assert part != null;
 
-                        boolean last = supplyMsg.last() != null && 
supplyMsg.last().containsKey(p);
+                        boolean last = F.mapContainsKey(supplyMsg.last(), p);
 
                         if (part.state() == MOVING) {
                             boolean reserved = part.reserve();
@@ -665,7 +665,7 @@ public class GridDhtPartitionDemander {
                     }
                 }
 
-                Collection<Integer> missed = supplyMsg.missed() == null ? 
Collections.emptyList() : supplyMsg.missed();
+                Collection<Integer> missed = F.emptyIfNull(supplyMsg.missed());
 
                 // Only request partitions based on latest topology version.
                 for (Integer miss : missed) {
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
index e36018e4839..530de8e0990 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.managers.communication.ErrorMessage;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection;
 import org.apache.ignite.internal.processors.cache.CacheGroupContext;
@@ -34,7 +35,6 @@ import 
org.apache.ignite.internal.processors.cache.GridCacheGroupIdMessage;
 import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -67,13 +67,9 @@ public class GridDhtPartitionSupplyMessage extends 
GridCacheGroupIdMessage imple
     @Order(value = 9, method = "messageSize")
     private int msgSize;
 
-    /** Supplying process error. */
-    private Throwable err;
-
-    // TODO: Should be removed in 
https://issues.apache.org/jira/browse/IGNITE-26523
-    /** Serialized form of supplying process error. */
-    @Order(10)
-    private byte[] errBytes;
+    /** Supplying process error message. */
+    @Order(value = 10, method = "errorMessage")
+    private @Nullable ErrorMessage errMsg;
 
     /**
      * @param rebalanceId Rebalance id.
@@ -110,7 +106,9 @@ public class GridDhtPartitionSupplyMessage extends 
GridCacheGroupIdMessage imple
         this.rebalanceId = rebalanceId;
         this.topVer = topVer;
         this.addDepInfo = addDepInfo;
-        this.err = err;
+
+        if (err != null)
+            errMsg = new ErrorMessage(err);
     }
 
     /**
@@ -234,21 +232,21 @@ public class GridDhtPartitionSupplyMessage extends 
GridCacheGroupIdMessage imple
 
     /** Supplying process error. */
     @Nullable @Override public Throwable error() {
-        return err;
+        return ErrorMessage.error(errMsg);
     }
 
     /**
-     * @return Serialized form of supplying process error.
+     * @return Supplying process error message.
      */
-    public byte[] errBytes() {
-        return errBytes;
+    @Nullable public ErrorMessage errorMessage() {
+        return errMsg;
     }
 
     /**
-     * @param errBytes New serialized form of supplying process error.
+     * @param errMsg New supplying process error message.
      */
-    public void errBytes(byte[] errBytes) {
-        this.errBytes = errBytes;
+    public void errorMessage(@Nullable ErrorMessage errMsg) {
+        this.errMsg = errMsg;
     }
 
     /**
@@ -295,15 +293,6 @@ public class GridDhtPartitionSupplyMessage extends 
GridCacheGroupIdMessage imple
         infoCol.add(info);
     }
 
-    /** {@inheritDoc} */
-    @Override public void prepareMarshal(GridCacheSharedContext<?, ?> ctx) 
throws IgniteCheckedException {
-        super.prepareMarshal(ctx);
-
-        // TODO: Should be removed in 
https://issues.apache.org/jira/browse/IGNITE-26523
-        if (err != null && errBytes == null)
-            errBytes = U.marshal(ctx, err);
-    }
-
     /** {@inheritDoc} */
     @Override public void finishUnmarshal(GridCacheSharedContext<?, ?> ctx, 
ClassLoader ldr) throws IgniteCheckedException {
         super.finishUnmarshal(ctx, ldr);
@@ -319,10 +308,6 @@ public class GridDhtPartitionSupplyMessage extends 
GridCacheGroupIdMessage imple
             for (int i = 0; i < entries.size(); i++)
                 entries.get(i).unmarshal(grp.cacheObjectContext(), ldr);
         }
-
-        // TODO: Should be removed in 
https://issues.apache.org/jira/browse/IGNITE-26523
-        if (errBytes != null && err == null)
-            err = U.unmarshal(ctx, errBytes, U.resolveClassLoader(ldr, 
ctx.gridConfig()));
     }
 
     /** {@inheritDoc} */

Reply via email to