shishkovilja commented on code in PR #12744:
URL: https://github.com/apache/ignite/pull/12744#discussion_r2826800225


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##########
@@ -49,63 +45,53 @@ public class CacheContinuousQueryEntry implements 
GridCacheDeployable, Message {
     /** */
     private static final byte KEEP_BINARY = 0b0100;
 
-    /** */
-    private static final EventType[] EVT_TYPE_VALS = EventType.values();
-
-    /**
-     * @param ord Event type ordinal value.
-     * @return Event type.
-     */
-    @Nullable public static EventType eventTypeFromOrdinal(int ord) {
-        return ord >= 0 && ord < EVT_TYPE_VALS.length ? EVT_TYPE_VALS[ord] : 
null;
-    }
+    /** Cache name. */
+    @Order(0)
+    private int cacheId;
 
     /** */
-    @GridCodegenConverter(
-        type = byte.class,
-        get = "evtType != null ? (byte)evtType.ordinal() : -1",
-        set = "eventTypeFromOrdinal($val$)"
-    )
+    @Order(value = 1, method = "eventType")
     private EventType evtType;
 
+    /** */
+    @Order(2)
+    private long filteredCnt;
+
+    /** Flags. */
+    @Order(3)
+    private byte flags;

Review Comment:
   Why moved?



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java:
##########
@@ -34,21 +36,31 @@
 import org.apache.ignite.internal.direct.DirectMessageWriter;
 import org.apache.ignite.internal.managers.communication.GridIoMessageFactory;
 import 
org.apache.ignite.internal.managers.communication.IgniteMessageFactoryImpl;
+import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoBean;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.CacheObjectImpl;
 import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl;
+import org.apache.ignite.lang.IgniteUuid;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.plugin.extensions.communication.MessageFactory;
 import 
org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
+import org.apache.ignite.plugin.extensions.communication.MessageSerializer;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.junit.Test;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.configuration.DeploymentMode.CONTINUOUS;
 
 /**
  *
  */
 public class IgniteCacheContinuousQueryImmutableEntryTest extends 
GridCommonAbstractTest {
+    /** Message factory. */

Review Comment:
   Why is it moved here? Why protected? Are there any significant reason for 
this?
   



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##########
@@ -49,63 +45,53 @@ public class CacheContinuousQueryEntry implements 
GridCacheDeployable, Message {
     /** */
     private static final byte KEEP_BINARY = 0b0100;
 
-    /** */
-    private static final EventType[] EVT_TYPE_VALS = EventType.values();
-
-    /**
-     * @param ord Event type ordinal value.
-     * @return Event type.
-     */
-    @Nullable public static EventType eventTypeFromOrdinal(int ord) {
-        return ord >= 0 && ord < EVT_TYPE_VALS.length ? EVT_TYPE_VALS[ord] : 
null;
-    }
+    /** Cache name. */
+    @Order(0)
+    private int cacheId;
 
     /** */
-    @GridCodegenConverter(
-        type = byte.class,
-        get = "evtType != null ? (byte)evtType.ordinal() : -1",
-        set = "eventTypeFromOrdinal($val$)"
-    )
+    @Order(value = 1, method = "eventType")
     private EventType evtType;
 
+    /** */
+    @Order(2)
+    private long filteredCnt;
+
+    /** Flags. */
+    @Order(3)
+    private byte flags;
+
     /** Key. */
     @GridToStringInclude
-    @GridCodegenConverter(get = "isFiltered() ? null : key")
+    @Order(value = 4, method = "keyObject")
     private KeyCacheObject key;
 
     /** New value. */
     @GridToStringInclude
-    @GridCodegenConverter(get = "isFiltered() ? null : newVal")
+    @Order(value = 5, method = "newValueObject")
     private CacheObject newVal;
 
     /** Old value. */
     @GridToStringInclude
-    @GridCodegenConverter(get = "isFiltered() ? null : oldVal")
+    @Order(value = 6, method = "oldValueObject")
     private CacheObject oldVal;
 
-    /** Cache name. */
-    private int cacheId;
-
-    /** Deployment info. */
-    @GridToStringExclude
-    @GridDirectTransient
-    private GridDeploymentInfo depInfo;
-
     /** Partition. */
+    @Order(7)
     private int part;
 
-    /** Update counter. */
-    private long updateCntr;
-
-    /** Flags. */
-    private byte flags;
-
     /** */
     @GridToStringInclude
+    @Order(value = 8, method = "topologyVersion")
     private AffinityTopologyVersion topVer;
 
-    /** */
-    private long filteredCnt;
+    /** Update counter. */
+    @Order(9)
+    private long updateCntr;

Review Comment:
   Why moved?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##########
@@ -49,63 +45,53 @@ public class CacheContinuousQueryEntry implements 
GridCacheDeployable, Message {
     /** */
     private static final byte KEEP_BINARY = 0b0100;
 
-    /** */
-    private static final EventType[] EVT_TYPE_VALS = EventType.values();
-
-    /**
-     * @param ord Event type ordinal value.
-     * @return Event type.
-     */
-    @Nullable public static EventType eventTypeFromOrdinal(int ord) {
-        return ord >= 0 && ord < EVT_TYPE_VALS.length ? EVT_TYPE_VALS[ord] : 
null;
-    }
+    /** Cache name. */
+    @Order(0)
+    private int cacheId;
 
     /** */
-    @GridCodegenConverter(
-        type = byte.class,
-        get = "evtType != null ? (byte)evtType.ordinal() : -1",
-        set = "eventTypeFromOrdinal($val$)"
-    )
+    @Order(value = 1, method = "eventType")
     private EventType evtType;
 
+    /** */
+    @Order(2)
+    private long filteredCnt;

Review Comment:
   Why moved?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##########
@@ -49,63 +45,53 @@ public class CacheContinuousQueryEntry implements 
GridCacheDeployable, Message {
     /** */
     private static final byte KEEP_BINARY = 0b0100;
 
-    /** */
-    private static final EventType[] EVT_TYPE_VALS = EventType.values();
-
-    /**
-     * @param ord Event type ordinal value.
-     * @return Event type.
-     */
-    @Nullable public static EventType eventTypeFromOrdinal(int ord) {
-        return ord >= 0 && ord < EVT_TYPE_VALS.length ? EVT_TYPE_VALS[ord] : 
null;
-    }
+    /** Cache name. */
+    @Order(0)
+    private int cacheId;

Review Comment:
   Why moved? Purpose of change?



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java:
##########
@@ -145,36 +157,30 @@ public void testCacheContinuousQueryEntrySerialization() {
             new AffinityTopologyVersion(1L),
             (byte)0);
 
-        e0.markFiltered();
-
-        IgniteMessageFactoryImpl msgFactory =
-            new IgniteMessageFactoryImpl(new MessageFactoryProvider[]{new 
GridIoMessageFactory()});
+        srcMsg.markFiltered();
 
-        ByteBuffer buf = ByteBuffer.allocate(4096);
-        DirectMessageWriter writer = new DirectMessageWriter(msgFactory);
+        srcMsg.prepare(new GridDeploymentInfoBean(
+            IgniteUuid.randomUuid(), "", CONTINUOUS, Map.of()
+        ));
 
-        // Skip write class header.
-        writer.onHeaderWritten();
-        e0.writeTo(buf, writer);
+        var resMsg = doMarshalUnmarshal(srcMsg);

Review Comment:
   Can we keep old logic, except for usage of deprecated methods? Just replace 
logic, where serializer is necessry for test to work correctly.



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java:
##########
@@ -133,7 +145,7 @@ public void testEventAvailabilityScope() throws Exception {
      */
     @Test
     public void testCacheContinuousQueryEntrySerialization() {
-        CacheContinuousQueryEntry e0 = new CacheContinuousQueryEntry(
+        var srcMsg = new CacheContinuousQueryEntry(

Review Comment:
   Unnecessary edit



-- 
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]

Reply via email to