2424import java .util .Map ;
2525import org .apache .ignite .IgniteCheckedException ;
2626import org .apache .ignite .internal .Order ;
27+ import org .apache .ignite .internal .managers .communication .ErrorMessage ;
2728import org .apache .ignite .internal .processors .affinity .AffinityTopologyVersion ;
2829import org .apache .ignite .internal .processors .cache .CacheEntryInfoCollection ;
2930import org .apache .ignite .internal .processors .cache .CacheGroupContext ;
3435import org .apache .ignite .internal .processors .cache .GridCacheSharedContext ;
3536import org .apache .ignite .internal .util .tostring .GridToStringInclude ;
3637import org .apache .ignite .internal .util .typedef .internal .S ;
37- import org .apache .ignite .internal .util .typedef .internal .U ;
3838import org .jetbrains .annotations .Nullable ;
3939
4040/**
@@ -67,13 +67,9 @@ public class GridDhtPartitionSupplyMessage extends GridCacheGroupIdMessage imple
6767 @ Order (value = 9 , method = "messageSize" )
6868 private int msgSize ;
6969
70- /** Supplying process error. */
71- private Throwable err ;
72-
73- // TODO: Should be removed in https://issues.apache.org/jira/browse/IGNITE-26523
74- /** Serialized form of supplying process error. */
75- @ Order (10 )
76- private byte [] errBytes ;
70+ /** Supplying process error message. */
71+ @ Order (value = 10 , method = "errorMessage" )
72+ private @ Nullable ErrorMessage errMsg ;
7773
7874 /**
7975 * @param rebalanceId Rebalance id.
@@ -110,7 +106,9 @@ public class GridDhtPartitionSupplyMessage extends GridCacheGroupIdMessage imple
110106 this .rebalanceId = rebalanceId ;
111107 this .topVer = topVer ;
112108 this .addDepInfo = addDepInfo ;
113- this .err = err ;
109+
110+ if (err != null )
111+ errMsg = new ErrorMessage (err );
114112 }
115113
116114 /**
@@ -234,21 +232,21 @@ public void infos(Map<Integer, CacheEntryInfoCollection> infos) {
234232
235233 /** Supplying process error. */
236234 @ Nullable @ Override public Throwable error () {
237- return err ;
235+ return ErrorMessage . error ( errMsg ) ;
238236 }
239237
240238 /**
241- * @return Serialized form of supplying process error.
239+ * @return Supplying process error message .
242240 */
243- public byte [] errBytes () {
244- return errBytes ;
241+ @ Nullable public ErrorMessage errorMessage () {
242+ return errMsg ;
245243 }
246244
247245 /**
248- * @param errBytes New serialized form of supplying process error.
246+ * @param errMsg New supplying process error message .
249247 */
250- public void errBytes ( byte [] errBytes ) {
251- this .errBytes = errBytes ;
248+ public void errorMessage ( @ Nullable ErrorMessage errMsg ) {
249+ this .errMsg = errMsg ;
252250 }
253251
254252 /**
@@ -295,15 +293,6 @@ void addEntry0(int p, boolean historical, GridCacheEntryInfo info, GridCacheShar
295293 infoCol .add (info );
296294 }
297295
298- /** {@inheritDoc} */
299- @ Override public void prepareMarshal (GridCacheSharedContext <?, ?> ctx ) throws IgniteCheckedException {
300- super .prepareMarshal (ctx );
301-
302- // TODO: Should be removed in https://issues.apache.org/jira/browse/IGNITE-26523
303- if (err != null && errBytes == null )
304- errBytes = U .marshal (ctx , err );
305- }
306-
307296 /** {@inheritDoc} */
308297 @ Override public void finishUnmarshal (GridCacheSharedContext <?, ?> ctx , ClassLoader ldr ) throws IgniteCheckedException {
309298 super .finishUnmarshal (ctx , ldr );
@@ -319,10 +308,6 @@ void addEntry0(int p, boolean historical, GridCacheEntryInfo info, GridCacheShar
319308 for (int i = 0 ; i < entries .size (); i ++)
320309 entries .get (i ).unmarshal (grp .cacheObjectContext (), ldr );
321310 }
322-
323- // TODO: Should be removed in https://issues.apache.org/jira/browse/IGNITE-26523
324- if (errBytes != null && err == null )
325- err = U .unmarshal (ctx , errBytes , U .resolveClassLoader (ldr , ctx .gridConfig ()));
326311 }
327312
328313 /** {@inheritDoc} */
0 commit comments