sergey-chugunov-1985 commented on code in PR #12387:
URL: https://github.com/apache/ignite/pull/12387#discussion_r2410454771
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java:
##########
@@ -17,52 +17,38 @@
package org.apache.ignite.internal.processors.cache.distributed.dht.preloader;
-import java.nio.ByteBuffer;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.GridDirectTransient;
-import org.apache.ignite.internal.IgniteCodeGeneratingFail;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.GridCacheGroupIdMessage;
import
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager;
-import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
import org.jetbrains.annotations.NotNull;
/**
* Partition demand request.
*/
-@IgniteCodeGeneratingFail
public class GridDhtPartitionDemandMessage extends GridCacheGroupIdMessage {
/** Cache rebalance topic. */
- private static final Object REBALANCE_TOPIC =
GridCachePartitionExchangeManager.rebalanceTopic(0);
+ public static final Object REBALANCE_TOPIC =
GridCachePartitionExchangeManager.rebalanceTopic(0);
Review Comment:
It is a bad place to put this constant to a message class. Lets move it to
`GridDhtPreloader` as it is in the same package as both
`GridDhtPartitionDemander` and `GridDhtPartitionSupplier` and orchestrates
rebalancing process.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/IgniteDhtDemandedPartitionsMap.java:
##########
@@ -23,24 +23,31 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.plugin.extensions.communication.Message;
import org.jetbrains.annotations.Nullable;
/**
* Map of partitions demanded during rebalancing.
*/
-public class IgniteDhtDemandedPartitionsMap implements Serializable {
+public class IgniteDhtDemandedPartitionsMap implements Serializable, Message {
Review Comment:
I suggest to remove `Serializable` interface from this class and re-run TC.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/IgniteDhtDemandedPartitionsMap.java:
##########
@@ -23,24 +23,31 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.plugin.extensions.communication.Message;
import org.jetbrains.annotations.Nullable;
/**
* Map of partitions demanded during rebalancing.
*/
-public class IgniteDhtDemandedPartitionsMap implements Serializable {
+public class IgniteDhtDemandedPartitionsMap implements Serializable, Message {
+ /** */
+ public static final short TYPE_CODE = 189;
+
/** */
private static final long serialVersionUID = 0L;
/** Map of partitions that will be preloaded from history. (partId ->
(fromCntr, toCntr)). */
+ @Order(value = 0, method = "historicalMap")
private CachePartitionPartialCountersMap historical;
/** Set of partitions that will be preloaded from all it's current data. */
Review Comment:
This javadoc is vague, lets improve it.
I suggest the following: `Set of partitions that require full rebalancing.`
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionPartialCountersMap.java:
##########
@@ -21,33 +21,42 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.plugin.extensions.communication.Message;
/**
*
*/
-public class CachePartitionPartialCountersMap implements Serializable {
+public class CachePartitionPartialCountersMap implements Serializable, Message
{
Review Comment:
I suggest to remove `Serializable` interface from this class and run TC
again to see if any tests fail.
--
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]