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 67ddff930b8 [AINode] Fix call inference error (#17308)
67ddff930b8 is described below
commit 67ddff930b860785bb9d491be225f47d53cf1715
Author: Yongzao <[email protected]>
AuthorDate: Tue Mar 17 21:53:54 2026 +0800
[AINode] Fix call inference error (#17308)
---
.../iotdb/commons/model/ModelInformation.java | 66 +---------------------
.../org/apache/iotdb/commons/model/ModelType.java | 26 ---------
2 files changed, 2 insertions(+), 90 deletions(-)
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/model/ModelInformation.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/model/ModelInformation.java
index 01968833db7..161a837ccc3 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/model/ModelInformation.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/model/ModelInformation.java
@@ -35,8 +35,6 @@ public class ModelInformation {
private static final int[] DEFAULT_MODEL_INPUT_SHAPE = new int[] {2880, 1};
private static final int[] DEFAULT_MODEL_OUTPUT_SHAPE = new int[] {720, 1};
- ModelType modelType;
-
private final String modelId;
private final int[] inputShape;
@@ -60,7 +58,6 @@ public class ModelInformation {
}
public ModelInformation(
- ModelType modelType,
String modelId,
int[] inputShape,
int[] outputShape,
@@ -68,7 +65,6 @@ public class ModelInformation {
TSDataType[] outputDataType,
String attribute,
ModelStatus status) {
- this.modelType = modelType;
this.modelId = modelId;
this.inputShape = inputShape;
this.outputShape = outputShape;
@@ -85,7 +81,6 @@ public class ModelInformation {
TSDataType[] inputDataType,
TSDataType[] outputDataType,
String attribute) {
- this.modelType = ModelType.USER_DEFINED;
this.modelId = modelId;
this.inputShape = inputShape;
this.outputShape = outputShape;
@@ -95,7 +90,6 @@ public class ModelInformation {
}
public ModelInformation(String modelId, ModelStatus status) {
- this.modelType = ModelType.BUILT_IN_FORECAST;
this.modelId = modelId;
this.inputShape = new int[0];
this.outputShape = new int[0];
@@ -104,21 +98,6 @@ public class ModelInformation {
this.status = status;
}
- // init built-in modelInformation
- public ModelInformation(ModelType modelType, String modelId) {
- this.modelType = modelType;
- this.modelId = modelId;
- this.inputShape = new int[2];
- this.outputShape = new int[2];
- this.inputDataType = new TSDataType[0];
- this.outputDataType = new TSDataType[0];
- this.status = ModelStatus.ACTIVE;
- }
-
- public boolean isBuiltIn() {
- return modelType != ModelType.USER_DEFINED;
- }
-
public boolean available() {
return status == ModelStatus.ACTIVE;
}
@@ -139,26 +118,6 @@ public class ModelInformation {
outputShape[0] = length;
}
- // calculation modelType and outputColumn metadata for different built-in
models
- public void setInputColumnSize(int size) {
- inputShape[1] = size;
- if (modelType == ModelType.BUILT_IN_FORECAST) {
- outputShape[1] = size;
- } else if (modelType == ModelType.BUILT_IN_ANOMALY_DETECTION) {
- outputShape[1] = 1;
- } else {
- outputShape[1] = size;
- }
- if (modelType == ModelType.BUILT_IN_FORECAST) {
- buildOutputDataTypeForBuiltInModel(TSDataType.DOUBLE, outputShape[1]);
- } else if (modelType == ModelType.BUILT_IN_ANOMALY_DETECTION) {
- buildOutputDataTypeForBuiltInModel(TSDataType.INT32, outputShape[1]);
- } else {
- buildOutputDataTypeForBuiltInModel(TSDataType.FLOAT, outputShape[1]);
- buildInputDataTypeForBuiltInModel(TSDataType.FLOAT, inputShape[1]);
- }
- }
-
public void setInputDataType(TSDataType[] inputDataType) {
this.inputDataType = inputDataType;
}
@@ -206,7 +165,6 @@ public class ModelInformation {
}
public void serialize(DataOutputStream stream) throws IOException {
- ReadWriteIOUtils.write(modelType.ordinal(), stream);
ReadWriteIOUtils.write(status.ordinal(), stream);
ReadWriteIOUtils.write(modelId, stream);
if (status == ModelStatus.UNAVAILABLE) {
@@ -231,7 +189,6 @@ public class ModelInformation {
}
public void serialize(FileOutputStream stream) throws IOException {
- ReadWriteIOUtils.write(modelType.ordinal(), stream);
ReadWriteIOUtils.write(status.ordinal(), stream);
ReadWriteIOUtils.write(modelId, stream);
if (status == ModelStatus.UNAVAILABLE) {
@@ -256,7 +213,6 @@ public class ModelInformation {
}
public void serialize(ByteBuffer byteBuffer) {
- ReadWriteIOUtils.write(modelType.ordinal(), byteBuffer);
ReadWriteIOUtils.write(status.ordinal(), byteBuffer);
ReadWriteIOUtils.write(modelId, byteBuffer);
if (status == ModelStatus.UNAVAILABLE) {
@@ -281,7 +237,6 @@ public class ModelInformation {
}
public static ModelInformation deserialize(ByteBuffer buffer) {
- ModelType modelType = ModelType.values()[ReadWriteIOUtils.readInt(buffer)];
ModelStatus status =
ModelStatus.values()[ReadWriteIOUtils.readInt(buffer)];
String modelName = ReadWriteIOUtils.readString(buffer);
if (status == ModelStatus.UNAVAILABLE) {
@@ -311,18 +266,10 @@ public class ModelInformation {
String attribute = ReadWriteIOUtils.readString(buffer);
return new ModelInformation(
- modelType,
- modelName,
- inputShape,
- outputShape,
- inputDataType,
- outputDataType,
- attribute,
- status);
+ modelName, inputShape, outputShape, inputDataType, outputDataType,
attribute, status);
}
public static ModelInformation deserialize(InputStream stream) throws
IOException {
- ModelType modelType = ModelType.values()[ReadWriteIOUtils.readInt(stream)];
ModelStatus status =
ModelStatus.values()[ReadWriteIOUtils.readInt(stream)];
String modelName = ReadWriteIOUtils.readString(stream);
if (status == ModelStatus.UNAVAILABLE) {
@@ -351,21 +298,13 @@ public class ModelInformation {
String attribute = ReadWriteIOUtils.readString(stream);
return new ModelInformation(
- modelType,
- modelName,
- inputShape,
- outputShape,
- inputDataType,
- outputDataType,
- attribute,
- status);
+ modelName, inputShape, outputShape, inputDataType, outputDataType,
attribute, status);
}
public ByteBuffer serializeShowModelResult() throws IOException {
PublicBAOS buffer = new PublicBAOS();
DataOutputStream stream = new DataOutputStream(buffer);
ReadWriteIOUtils.write(modelId, stream);
- ReadWriteIOUtils.write(modelType.toString(), stream);
ReadWriteIOUtils.write(status.toString(), stream);
ReadWriteIOUtils.write(Arrays.toString(inputShape), stream);
ReadWriteIOUtils.write(Arrays.toString(outputShape), stream);
@@ -382,7 +321,6 @@ public class ModelInformation {
if (obj instanceof ModelInformation) {
ModelInformation other = (ModelInformation) obj;
return modelId.equals(other.modelId)
- && modelType.equals(other.modelType)
&& Arrays.equals(inputShape, other.inputShape)
&& Arrays.equals(outputShape, other.outputShape)
&& Arrays.equals(inputDataType, other.inputDataType)
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/model/ModelType.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/model/ModelType.java
deleted file mode 100644
index cd154748f23..00000000000
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/model/ModelType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.commons.model;
-
-public enum ModelType {
- BUILT_IN_FORECAST,
- BUILT_IN_ANOMALY_DETECTION,
- USER_DEFINED
-}