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 8c3ea08f731 IGNITE-26483 Use MessageSerializer for 
CacheContinuousQueryBatchAck (#12365)
8c3ea08f731 is described below

commit 8c3ea08f731797e4b58a78676ea0b47484db791b
Author: Denis <[email protected]>
AuthorDate: Tue Sep 30 23:24:45 2025 +1000

    IGNITE-26483 Use MessageSerializer for CacheContinuousQueryBatchAck (#12365)
---
 .../communication/GridIoMessageFactory.java        |  3 +-
 .../continuous/CacheContinuousQueryBatchAck.java   | 84 +++++-----------------
 2 files changed, 19 insertions(+), 68 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
index 50f6d2df1a3..695741d1b72 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.GridTaskCancelRequest;
 import org.apache.ignite.internal.GridTaskSessionRequest;
 import org.apache.ignite.internal.IgniteDiagnosticMessage;
 import 
org.apache.ignite.internal.codegen.AtomicApplicationAttributesAwareRequestSerializer;
+import 
org.apache.ignite.internal.codegen.CacheContinuousQueryBatchAckSerializer;
 import org.apache.ignite.internal.codegen.CacheEvictionEntrySerializer;
 import org.apache.ignite.internal.codegen.CacheGroupAffinityMessageSerializer;
 import org.apache.ignite.internal.codegen.CacheVersionedValueSerializer;
@@ -341,7 +342,7 @@ public class GridIoMessageFactory implements 
MessageFactoryProvider {
         factory.register((short)115, UUIDCollectionMessage::new);
         factory.register((short)116, GridNearSingleGetRequest::new);
         factory.register((short)117, GridNearSingleGetResponse::new);
-        factory.register((short)118, CacheContinuousQueryBatchAck::new);
+        factory.register((short)118, CacheContinuousQueryBatchAck::new, new 
CacheContinuousQueryBatchAckSerializer());
 
         // [120..123] - DR
         factory.register((short)125, GridNearAtomicSingleUpdateRequest::new);
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryBatchAck.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryBatchAck.java
index 3a1d531c172..fb80aa2e598 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryBatchAck.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryBatchAck.java
@@ -17,27 +17,24 @@
 
 package org.apache.ignite.internal.processors.cache.query.continuous;
 
-import java.nio.ByteBuffer;
 import java.util.Map;
 import java.util.UUID;
-import org.apache.ignite.internal.GridDirectMap;
+import org.apache.ignite.internal.Order;
 import org.apache.ignite.internal.processors.cache.GridCacheIdMessage;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import 
org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 
 /**
  * Batch acknowledgement.
  */
 public class CacheContinuousQueryBatchAck extends GridCacheIdMessage {
     /** Routine ID. */
+    @Order(4)
     private UUID routineId;
 
     /** Update counters. */
+    @Order(5)
     @GridToStringInclude
-    @GridDirectMap(keyType = Integer.class, valueType = Long.class)
     private Map<Integer, Long> updateCntrs;
 
     /**
@@ -61,76 +58,29 @@ public class CacheContinuousQueryBatchAck extends 
GridCacheIdMessage {
     /**
      * @return Routine ID.
      */
-    UUID routineId() {
+    public UUID routineId() {
         return routineId;
     }
 
     /**
-     * @return Update counters.
+     * @param routineId Routine ID.
      */
-    Map<Integer, Long> updateCntrs() {
-        return updateCntrs;
+    public void routineId(UUID routineId) {
+        this.routineId = routineId;
     }
 
-    /** {@inheritDoc} */
-    @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
-        writer.setBuffer(buf);
-
-        if (!super.writeTo(buf, writer))
-            return false;
-
-        if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(directType()))
-                return false;
-
-            writer.onHeaderWritten();
-        }
-
-        switch (writer.state()) {
-            case 4:
-                if (!writer.writeUuid(routineId))
-                    return false;
-
-                writer.incrementState();
-
-            case 5:
-                if (!writer.writeMap(updateCntrs, 
MessageCollectionItemType.INT, MessageCollectionItemType.LONG))
-                    return false;
-
-                writer.incrementState();
-
-        }
-
-        return true;
+    /**
+     * @return Update counters.
+     */
+    public Map<Integer, Long> updateCntrs() {
+        return updateCntrs;
     }
 
-    /** {@inheritDoc} */
-    @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
-        reader.setBuffer(buf);
-
-        if (!super.readFrom(buf, reader))
-            return false;
-
-        switch (reader.state()) {
-            case 4:
-                routineId = reader.readUuid();
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 5:
-                updateCntrs = reader.readMap(MessageCollectionItemType.INT, 
MessageCollectionItemType.LONG, false);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-        }
-
-        return true;
+    /**
+     * @param updateCntrs Update counters.
+     */
+    public void updateCntrs(Map<Integer, Long> updateCntrs) {
+        this.updateCntrs = updateCntrs;
     }
 
     /** {@inheritDoc} */

Reply via email to