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

yongzao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 800f95ddc3c [AINode] Modify heartbeat field (#15953)
800f95ddc3c is described below

commit 800f95ddc3c7863475bd54af2bd2b024898555a8
Author: Yongzao <[email protected]>
AuthorDate: Thu Jul 17 11:43:16 2025 +0800

    [AINode] Modify heartbeat field (#15953)
---
 .../confignode/manager/load/service/HeartbeatService.java      |  4 ++--
 .../org/apache/iotdb/commons/client/ainode/AINodeClient.java   |  5 ++---
 iotdb-protocol/thrift-ainode/src/main/thrift/ainode.thrift     | 10 ++++++----
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
index 9e630733025..360935d85fc 100644
--- 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
+++ 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
@@ -133,7 +133,7 @@ public class HeartbeatService {
                 pingRegisteredDataNodes(
                     genHeartbeatReq(), 
getNodeManager().getRegisteredDataNodes());
                 // Send heartbeat requests to all the registered AINodes
-                pingRegisteredAINodes(genMLHeartbeatReq(), 
getNodeManager().getRegisteredAINodes());
+                pingRegisteredAINodes(genAIHeartbeatReq(), 
getNodeManager().getRegisteredAINodes());
               }
             });
   }
@@ -213,7 +213,7 @@ public class HeartbeatService {
     return req;
   }
 
-  private TAIHeartbeatReq genMLHeartbeatReq() {
+  private TAIHeartbeatReq genAIHeartbeatReq() {
     /* Generate heartbeat request */
     TAIHeartbeatReq heartbeatReq = new TAIHeartbeatReq();
     heartbeatReq.setHeartbeatTimestamp(System.nanoTime());
diff --git 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClient.java
 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClient.java
index a7bcd82397c..99479256664 100644
--- 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClient.java
+++ 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClient.java
@@ -57,7 +57,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.Map;
 import java.util.Optional;
 
@@ -224,14 +223,14 @@ public class AINodeClient implements AutoCloseable, 
ThriftClient {
     } catch (IOException e) {
       TSStatus tsStatus = new TSStatus(INTERNAL_SERVER_ERROR.getStatusCode());
       tsStatus.setMessage(String.format("Failed to serialize input tsblock 
%s", e.getMessage()));
-      return new TForecastResp(tsStatus, ByteBuffer.allocate(0));
+      return new TForecastResp(tsStatus);
     } catch (TException e) {
       TSStatus tsStatus = new TSStatus(CAN_NOT_CONNECT_AINODE.getStatusCode());
       tsStatus.setMessage(
           String.format(
               "Failed to connect to AINode when executing %s: %s",
               Thread.currentThread().getStackTrace()[1].getMethodName(), 
e.getMessage()));
-      return new TForecastResp(tsStatus, ByteBuffer.allocate(0));
+      return new TForecastResp(tsStatus);
     }
   }
 
diff --git a/iotdb-protocol/thrift-ainode/src/main/thrift/ainode.thrift 
b/iotdb-protocol/thrift-ainode/src/main/thrift/ainode.thrift
index 148b2d8d49b..e09d0360c84 100644
--- a/iotdb-protocol/thrift-ainode/src/main/thrift/ainode.thrift
+++ b/iotdb-protocol/thrift-ainode/src/main/thrift/ainode.thrift
@@ -25,16 +25,18 @@ struct TDeleteModelReq {
   1: required string modelId
 }
 
-struct TAIHeartbeatReq{
+struct TAIHeartbeatReq {
   1: required i64 heartbeatTimestamp
   2: required bool needSamplingLoad
+  3: optional bool activated
 }
 
-struct TAIHeartbeatResp{
+struct TAIHeartbeatResp {
   1: required i64 heartbeatTimestamp
   2: required string status
   3: optional string statusReason
   4: optional common.TLoadSample loadSample
+  5: optional string activateStatus
 }
 
 struct TRegisterModelReq {
@@ -69,7 +71,7 @@ struct TWindowParams {
 
 struct TInferenceResp {
   1: required common.TSStatus status
-  2: required list<binary> inferenceResult
+  2: optional list<binary> inferenceResult
 }
 
 struct IDataSchema {
@@ -94,7 +96,7 @@ struct TForecastReq {
 
 struct TForecastResp {
   1: required common.TSStatus status
-  2: required binary forecastResult
+  2: optional binary forecastResult
 }
 
 struct TShowModelsReq {

Reply via email to